|
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 |
M[a]nny Smarty n00b
Joined: 19 Jan 2011 Posts: 1
|
Posted: Mon Apr 07, 2014 6:44 am Post subject: How to pass parameter between tags in smarty? |
|
|
Let's imagine we have this HTML code:
Code: | <div class="block">
<div class="block-head">This is title</div>
<div class="block-body">This is body</div>
</div> |
Now, let's make TPL (myblock.tpl):
Code: | <div class="block">
<div class="block-head">{$title}</div>
<div class="block-body">{$body}</div>
</div> |
I am able to do this now:
Code: | {include file="myblock.tpl" title="User Settings" body="<div>HELLO</div>"} |
And result would be:
Code: | <div class="block">
<div class="block-head">User Settings</div>
<div class="block-body"<div>HELLO</div></div>
</div> |
But is there any way to do with smarty something like this?
Code: | {include file="myblock.tpl" title="User Settings"}
<div>HELLO</div>
{/include} |
|
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Mon Apr 07, 2014 6:30 pm Post subject: |
|
|
I think you are looking for something like template inheritance.
See http://www.smarty.net/inheritance for introduction |
|
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
|