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

Specif value in TPL in assign

 
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 -> General
View previous topic :: View next topic  
Author Message
emulienfou
Smarty Rookie


Joined: 28 May 2010
Posts: 18

PostPosted: Sat Jun 19, 2010 9:50 am    Post subject: Specif value in TPL in assign Reply with quote

Hello, I explain, I wanted to know if we could do something like this:

Defined in my fihcier PHP:
Code:
$smarty->assign('test' => '<input type="hidden" name="action" class="$var" value="logout" />');


TPL and the next, you can specify the class:
Code:
{$test.class}


So I wonder if it was possible to pass a value in my side TPL variable $ var which is quoted here as for PHP specify the name of the class used.

Best regards
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Sat Jun 19, 2010 2:26 pm    Post subject: Reply with quote

You are much better off keeping the HTML in templates. So example:

input.tpl:

Code:
<input type="hidden" name="action" class="{$class}" value="logout" />


parent.tpl:

Code:
{include file="input.tpl" class="myclass"}
Back to top
View user's profile Send private message Visit poster's website
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 -> 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