Re: [SMARTY-DEV] Re: Intelligent JavaScript handling
| From: | Mark Rogers | Date: | Fri, 19 Mar 2004 19:41:07 +0000 |
| Subject: | Re: [SMARTY-DEV] Re: Intelligent JavaScript handling | ||
| References: | 1 2 3 4 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-2227@lists.php.net to get a copy of this message | ||
Remy writes:
> function smarty_prefilter_literal_style(&$tpl_source, &$smarty)
> {
> $pattern[] = '~<style\b(?![^>]*smarty)>(.*)</style>~siU';
> $replace[] =
> '<!--{literal}--><style$1>$2</style><!--{/literal}-->';
> return preg_replace($pattern, $replace, $tpl_source);
> } // function
Unless I'm missing something this won't handle:
<style>
.main {
color: {$colors.main}
}
</style>
.. which is what I'm trying to achieve? (Or similar example in JS; I think
the CSS example is simpler to understand.)
--
Mark Rogers,
More Solutions Ltd