Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Assign flag for compiler tag functions

 
Post new topic   Reply to topic    Smarty Forum Index -> Feature Requests
View previous topic :: View next topic  
Author Message
dpatterson
Smarty Rookie


Joined: 12 Apr 2013
Posts: 16

PostPosted: Mon Jul 22, 2013 9:02 pm    Post subject: Assign flag for compiler tag functions Reply with quote

It would sometimes be very handy if there was a flag that could be checked or a method that could be called that would indicate whether the results of the current compiler tag will be assigned to a variable.

Example A: {myCompilerTag}
Example B: {$x = {myCompilerTag}}

The flag would be false in example A and true in example B.

This would be very useful in a project I'm working on where I'm implementing a Smarty interface to an older system and whether the value will be assigned or displayed can dictate which legacy function is to be called.

Thanks for your consideration.
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 4653
Location: Hamburg / Germany

PostPosted: Tue Jul 23, 2013 5:47 am    Post subject: Reply with quote

Sorry, with Smarty's lexer/parser it could not be implemented in an easy way. Also it could be solved with
{myTag assign='x'} as alreday discussed in http://www.smarty.net/forums/viewtopic.php?t=24444
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Feature Requests 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