|
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: Fri Dec 18, 2015 1:05 pm Post subject: nested tags inside name attribute |
|
|
It appears checking for illegal characters inside the name attribute does not allow nested smarty tags or backticks and/or variables.
We use [% %] as delimiters. This also fails if I try to use backticks
Code: |
... Syntax error in template...
"[%foreach from=$row.ToValues key="fieldChanged" item="fieldFrom" name="fieldsChanged[%$row.IdLicenceHistory%]" %]"
'name' attribute/variable has illegal value <-- thrown in ...\smarty_internal_templatecompilerbase.php on line 47
|
Smarty version 3.1.29-dev/3 |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sat Dec 19, 2015 11:08 pm Post subject: |
|
|
Smarty does not accept a name attribute which is variable.
Why do you need it at all, as it is optional.
Smarty has implemented the PHP like version of {foreach}.
See http://www.smarty.net/docs/en/language.function.foreach.tpl
It allow using special attributes like index, iteration etc. much simpler. |
|
Back to top |
|
liviu.gelea Smarty Rookie
Joined: 25 Nov 2015 Posts: 16
|
Posted: Mon Dec 21, 2015 9:22 am Post subject: Thanks |
|
|
Thanks for your answer. I suspected you might not want to fix this in smarty 3 due to it's non-standard-ness. I fixed this in my project but since I inherited a very large legacy codebase (smarty 2), my fixes might have been far from perfect.
Thanks for your time. |
|
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
|