|
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 |
Lillilotte Smarty Rookie
Joined: 09 Jan 2013 Posts: 8
|
Posted: Wed Jan 09, 2013 10:49 pm Post subject: Smarty 3.1.12: const compile failure |
|
|
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
but I get
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 |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Wed Jan 09, 2013 11:38 pm Post subject: |
|
|
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 |
|
Lillilotte Smarty Rookie
Joined: 09 Jan 2013 Posts: 8
|
Posted: Thu Jan 10, 2013 7:53 pm Post subject: |
|
|
Super! Thanks |
|
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
|