Re: [SMARTY] Template inside template
| From: | Rainer Müller | Date: | Sat, 08 Jan 2005 23:58:20 +0000 |
| Subject: | Re: [SMARTY] Template inside template | ||
| References: | 1 2 3 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-12124@lists.php.net to get a copy of this message | ||
HarryG wrote:
But will this also call the menu.php. Because there will be queries that need to be run before the menu.tpl can be displayed.No, you have to include the menu.php normally into your php code with: --index.php-- <?php // ... include 'menu.php'; // ... $smarty->display('index.tpl'); //with {include file="menu.tpl"} inside ?> --menu.php-- <?php // your queries and stuff... // the $smarty object comes directly from index.php $smarty->assign('menu', $menu); //example ?> --index.tpl-- <DOCTYPE...> <html> <head>...</head> <body> ... {* the template which will loop through $menu and output it *} {include file="menu.tpl"} ... </body> </html> Rainer