|
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 |
xces Smarty Regular
Joined: 09 Apr 2004 Posts: 77
|
Posted: Wed Jun 02, 2004 8:30 am Post subject: The correct usage of append ... ?? |
|
|
I made some code using the append function: Code: | $smarty->append('bla', 'You forgot your password'); |
However, i can't get it to work from my TPL: Code: | {if count($bla) gt 0}Errors occured...{/if} |
What am i doing wrong? When i print_r the smarty object, it shows this: Code: | ...
[_tpl_vars] => Array
(
[bla] => Array
(
[0] => You forgot your password.
)
)
...
| So giving this above, it SHOULD work but it doesn't ... it is driving me crazy.... |
|
Back to top |
|
kills Smarty Elite
Joined: 28 May 2004 Posts: 493
|
Posted: Wed Jun 02, 2004 9:25 am Post subject: Re: The correct usage of append ... ?? |
|
|
xces wrote: | I made some code using the append function: Code: | $smarty->append('bla', 'You forgot your password'); |
|
you have to use
Code: | $smarty->assign('bla', 'You forgot your password'); |
|
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Wed Jun 02, 2004 9:57 am Post subject: |
|
|
@xces: there is nothing wrong with what you did and I can confirm that your example does indeed work.
EDIT: I notice now that you entered this as a bug because of difficulty you are having in relation to SmartyValidate. I have not been following that development, but if you are having an issue in that context, it is likely that it is an interaction issue with that system rather than a bug in Smarty itself. |
|
Back to top |
|
xces Smarty Regular
Joined: 09 Apr 2004 Posts: 77
|
Posted: Wed Jun 02, 2004 12:17 pm Post subject: |
|
|
You are right boots, i think i found the problem. I checked for $bla before it was filled, kinda logical that is isn't set then.. You can delete this post if you wish |
|
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
|