|
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 |
emulienfou Smarty Rookie
Joined: 28 May 2010 Posts: 18
|
Posted: Sat Jun 19, 2010 9:50 am Post subject: Specif value in TPL in assign |
|
|
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:
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 |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Sat Jun 19, 2010 2:26 pm Post subject: |
|
|
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 |
|
|
|
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
|