|
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 |
andersjo Smarty n00b
Joined: 18 May 2007 Posts: 1
|
Posted: Fri May 18, 2007 9:33 am Post subject: Site engine |
|
|
Hi.
I'm using smarty for the first time and have some questions about how to best set up the site engine.
I would like to use different templates for the different pages on my site. The template to use is stored in the pageproperties table in the database. So when I enter an page, the index.php is called who finds which template to use and displays the templte
Code: | $smarty->display('header.tpl');
$smarty->display($template);
$smarty->display('footer.tpl'); |
But I would like some functionality in the template. I.E. I need to get the content for the page which is stored in the database. The different templates have their own functions. How can I add this functionality to the templates? Do I have to include $template.php (in index.php) which display the .tpl file or can the .tpl run some functions in a php-file before render?
What is the best prectice for my problem?
//andersjo |
|
Back to top |
|
toma Smarty Regular
Joined: 25 Apr 2003 Posts: 62
|
|
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
|