View previous topic :: View next topic |
Author |
Message |
danny36 Smarty Rookie
Joined: 14 Jul 2004 Posts: 27 Location: Italy - Arezzo (Tuscany)
|
Posted: Thu Jun 01, 2017 7:36 am Post subject: How to create single main template? |
|
|
Hello to all,
I would like to a achieve to have one single template with this:
<html>
<head></head>
<body>
{load content here}
</body>
</html>
when I click on a link to another php file I want to load the resulting generated template inside a tag {load content here} of the main template.
It's possible to do this?
thank you. |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
|
Back to top |
|
danny36 Smarty Rookie
Joined: 14 Jul 2004 Posts: 27 Location: Italy - Arezzo (Tuscany)
|
Posted: Thu Jun 01, 2017 12:29 pm Post subject: |
|
|
ok thank you but how to?
I have:
[list=]page1.php + page1.tpl
page2.php + page2.tpl
page3.php + page3.tpl[/list]
and in index.php I have:
$smarty->assign("content", $page);
How can assign the result of page1.php in a $page?? |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Thu Jun 01, 2017 1:21 pm Post subject: |
|
|
Ok, I understand what you are asking.
I suggest you start reading Smarty documentation from the beginning and try all the provided examples yourself.
What you want is the very basic functionality of Smarty (or any other templating engine), explained in the very first few paragraphs of its documentation. |
|
Back to top |
|
danny36 Smarty Rookie
Joined: 14 Jul 2004 Posts: 27 Location: Italy - Arezzo (Tuscany)
|
Posted: Tue Jun 13, 2017 7:56 am Post subject: |
|
|
I'm sorry but i can't find any specific example in the documentation of smarty. |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Tue Jun 13, 2017 1:26 pm Post subject: |
|
|
The entire documentation is an example of what you're asking for.
I fail to see how you could not find it. |
|
Back to top |
|
danny36 Smarty Rookie
Joined: 14 Jul 2004 Posts: 27 Location: Italy - Arezzo (Tuscany)
|
Posted: Tue Jun 13, 2017 2:11 pm Post subject: |
|
|
If I ask for help maybe I'm not reach the solution.
Somebody else can help me? |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
|
Back to top |
|
|