Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Compiler Plugin out of track

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty 3
View previous topic :: View next topic  
Author Message
bimal
Smarty Elite


Joined: 19 Apr 2007
Posts: 423

PostPosted: Sun Nov 29, 2009 10:08 pm    Post subject: Compiler Plugin out of track Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty 3 All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP