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

Smarty 3.1.12: const compile failure

 
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 -> Bugs
View previous topic :: View next topic  
Author Message
Lillilotte
Smarty Rookie


Joined: 09 Jan 2013
Posts: 8

PostPosted: Wed Jan 09, 2013 10:49 pm    Post subject: Smarty 3.1.12: const compile failure Reply with quote

If I tried something like
Code:

<?php
define('bar', 'foobar');
$smarty->assign('foo', 'bar');
?>

foobar.tpl:
{$smarty.const.$foo}
or
{$smarty.const.{$foo}}

I would expect an output like
Code:

foobar

but I get
Code:

bar


The reason is the compilation of the smarty compiler. That generates the following from the above:
Code:

<?php echo @$_smarty_tpl->tpl_vars['foo']->value;?>
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Wed Jan 09, 2013 11:38 pm    Post subject: Reply with quote

We did originally not support variable constants.

But it was easy it implement. This enhancement is now in the SVN trunk and will later be included in 3.1.13.
Back to top
View user's profile Send private message
Lillilotte
Smarty Rookie


Joined: 09 Jan 2013
Posts: 8

PostPosted: Thu Jan 10, 2013 7:53 pm    Post subject: Reply with quote

Super! Thanks
Back to top
View user's profile Send private message
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 -> Bugs 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