Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Variable value in "default"

 
Post new topic   Reply to topic    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
bluesapphire
Smarty Rookie


Joined: 03 Feb 2006
Posts: 5

PostPosted: Thu Feb 03, 2011 7:23 am    Post subject: Variable value in "default" Reply with quote

I have following input field:

Code:

<input type='text' id='username' class='textfield' value='{$username|default:$default_username_input_text}' />


The value of variable ($default_username_input_text) is coming from PHP.

My problem is that it is not showing value. Can some one guide me in this regards.

Iam using smarty 2.6

Thanks in advance
Back to top
View user's profile Send private message
Aristophan
Smarty Regular


Joined: 10 Jan 2011
Posts: 96

PostPosted: Thu Feb 03, 2011 8:43 am    Post subject: Reply with quote

Normally this {$username|@default:$duit} is doing well, if the vars are assigned to smarty.
If the second isn't, assign it in the php file, where it comes from like this
$smarty->assign('duit', $default_username_input_text);
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> General 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