|
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 |
r.yaroma Smarty n00b
Joined: 11 Aug 2014 Posts: 2
|
Posted: Mon Aug 11, 2014 8:27 am Post subject: Does not bind a variable with a specific name |
|
|
Hello, if I bind a variable named User
Code: | $output->Assign('User', $User); |
nothing happens,
Code: |
{*in template*}
{$User|@var_dump} // null
|
if I bind a variable with a different name - okay:
Code: | $output->Assign(UserData', $User); |
Code: |
{*in template*}
{$UserData|@var_dump} // object(User...
|
In what direction to think? |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Mon Aug 11, 2014 5:41 pm Post subject: |
|
|
Is $output an object of the Smarty class? Could it be that $output->Assign() is a method which filters variable names?
Code: | $smarty->assign('User', $User); |
Does work as expected and there are no restrictions with valid.
You could try to set
Code: | $smarty->debugging = true; |
And check if you see the variable assigned in the debug window. |
|
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
|