Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Does not bind a variable with a specific name

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty Development
View previous topic :: View next topic  
Author Message
r.yaroma
Smarty n00b


Joined: 11 Aug 2014
Posts: 2

PostPosted: Mon Aug 11, 2014 8:27 am    Post subject: Does not bind a variable with a specific name Reply with quote

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
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Mon Aug 11, 2014 5:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty Development All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP