Re[2]: [SMARTY-DEV] Intelligent JavaScript handling
| From: | Dmitry Koteroff | Date: | Mon, 31 May 2004 15:37:05 +0000 |
| Subject: | Re[2]: [SMARTY-DEV] Intelligent JavaScript handling | ||
| References: | 1 2 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-2348@lists.php.net to get a copy of this message | ||
MR> As to whether this is a specific Javascript issue - I don't think it is. For
MR> example, the following won't work:
MR> {literal}
MR> <style>
MR> .main {
MR> color: {$main.color};
MR> background-color: {$main.bgcolor};
MR> }
MR> </style>
MR> {/literal}
I use plugins to disable Smarty handling for { with spaces after
it:
# Quotes each "{" with spaces after it.
function smarty_prefilter_z_nonsmarty($source, &$smarty) {
$l = $smarty->left_delimiter;
$r = $smarty->right_delimiter;
$source = preg_replace('/'.preg_quote($l,
'/').'(?=[\s{(\[])/s', "{$l}ldelim{$r}", $source);
return $source;
}
Maybe it would help?
--
Best regards,
Dmitry Koteroff.