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

Query on use of {extends} with parent, child and grandchild

 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3
View previous topic :: View next topic  
Author Message
ananthbtechit
Smarty n00b


Joined: 25 Mar 2016
Posts: 3

PostPosted: Wed Oct 05, 2016 9:32 am    Post subject: Query on use of {extends} with parent, child and grandchild Reply with quote

In the Smarty 3.1 README file, please add more clarity with an example for the following explanation:
---------
Instead of defining the parent/child relationships with the {extends} tag in the child template you
can use the resource as follow:

$smarty->display('extends:parent.tpl|child.tpl|grandchild.tpl');

Child {block} tags may optionally have a append or prepend attribute. In this case the parent block content
is appended or prepended to the child block content.
-------------

It is not clear, when the "'extends:parent.tpl|child.tpl|grandchild.tpl" will use which template for rendering: parent.tpl, or child.tpl or grandchild.tpl?

It would be great if you could illustrate with an example.

Thanks in advance.
Back to top
View user's profile Send private message Send e-mail
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1583

PostPosted: Wed Oct 05, 2016 9:37 am    Post subject: Reply with quote

It will use normal inheritance order. As named.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3 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