|
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 |
liviu.gelea Smarty Rookie
Joined: 25 Nov 2015 Posts: 16
|
Posted: Wed Nov 25, 2015 12:38 pm Post subject: Problem with custom delimiters |
|
|
Hi. My company uses [% and %] as delimiters.
This creates some problems in smarty 3 since the following code will fail:
Code: | [%assign var=variable value=foo%]
[%assign var=var_foo value=bar%]
[%$var_[%$variable%]%]
|
while this would have worked
Code: | {assign var=variable value=foo}
{assign var=var_foo value=bar}
{$var_{$variable}}
|
I believe this is because "[" is interpreted as array access:
Code: | Fatal error: Uncaught --> Smarty Compiler: Syntax error in template ".........\bug.inc.php" on line 3 "[%$var_[%$variable%]%]" - Unexpected "%" <-- thrown in ............\smarty\sysplugins\smarty_internal_templatecompilerbase.php on line 3
|
|
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Wed Nov 25, 2015 8:20 pm Post subject: |
|
|
Thanks for bringing this up.
The fix is on github in the dev_master branch. |
|
Back to top |
|
liviu.gelea Smarty Rookie
Joined: 25 Nov 2015 Posts: 16
|
Posted: Thu Nov 26, 2015 3:36 pm Post subject: Thanks |
|
|
Thanks a lot. Your fix works like a charm.
You're a lightsaber... I mean life saver. And a lightsaber. |
|
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
|