|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
bimal Smarty Elite
Joined: 19 Apr 2007 Posts: 423
|
Posted: Sun Nov 29, 2009 10:08 pm Post subject: Compiler Plugin out of track |
|
|
Probably, there is a little knowledge about the compiler plugins, and almost we do not need it except for {assign}.
I have found that it has evolved out differently.
In the manual, an example is:
Code: | function smarty_compiler_tplheader($tag_arg, &$smarty) |
And in the real implementation, it is:
Code: | function smarty_compiler_assign($tag_attrs, &$compiler) |
I am trying to put a static css name to the compiled output, by taking the value of a dynamic variable that was available while compiling the template.
Code: | function smarty_compiler_remote_css($tag_attrs, &$compiler)
{
$_params = $compiler->_parse_attrs($tag_attrs);
if (!isset($_params['href'])) {
$compiler->_syntax_error("assign: missing 'href' parameter", E_USER_WARNING);
return;
}
return "echo {$_params['href']};";
} |
It now works for me, as I wanted. Put I need to work with the php tags: <?php and ?>, with echo. Plus the variable $_params['href'] is already en-quoted.
It would have been better, if I can write the only returned values there, without the <?php and ?> tags. And, if there is a need to write the tags, I should write the whole tags. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|