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

How to make main tempalte for all actions?

 
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
danny36
Smarty Rookie


Joined: 14 Jul 2004
Posts: 27
Location: Italy - Arezzo (Tuscany)

PostPosted: Fri Apr 06, 2018 9:28 am    Post subject: How to make main tempalte for all actions? Reply with quote

I want to build an application that have a single main template with inside a tamplate variable that display a resulting of url action.

Example:

When I call this url
http:www.mysite/user

resulting of user.php and user.tpl it's put in $content variable of main.tpl.

main.tpl
Code:

<html>
<head></head>
<body>

{$content}

</body>
</html>
Back to top
View user's profile Send private message Visit poster's website
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Fri Apr 06, 2018 7:37 pm    Post subject: Reply with quote

Build it inside out
See https://www.smarty.net/docs/en/language.function.extends.tpl
Back to top
View user's profile Send private message
danny36
Smarty Rookie


Joined: 14 Jul 2004
Posts: 27
Location: Italy - Arezzo (Tuscany)

PostPosted: Tue Apr 17, 2018 9:45 am    Post subject: Reply with quote

but with extends I must include this tag in all templates with also block tag.
Back to top
View user's profile Send private message Visit poster's website
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Wed Apr 18, 2018 11:09 pm    Post subject: Reply with quote

Yes, and?…
Back to top
View user's profile Send private message
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