webref.eu Posted June 26, 2009 Share Posted June 26, 2009 Hi All I need to learn how to put my PHP site into a template so that when I make a change to the template page design it can instantly be reflected right across the site. Where do I start? What search terms should I use to learn about this? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/163819-need-to-learn-about-php-templating/ Share on other sites More sharing options...
natepizzle Posted June 26, 2009 Share Posted June 26, 2009 http://us2.php.net/manual/en/function.include.php Quote Link to comment https://forums.phpfreaks.com/topic/163819-need-to-learn-about-php-templating/#findComment-864356 Share on other sites More sharing options...
Lumio Posted June 26, 2009 Share Posted June 26, 2009 Google: php template engine Result: http://www.smarty.net/ You can also create your own template-engine by using str_replace, or if you want to do some advanced stuff: preg_replace and preg_replace_callback Think about caching (by saving your template and content in an extra file) And include is not a good way to do so. Quote Link to comment https://forums.phpfreaks.com/topic/163819-need-to-learn-about-php-templating/#findComment-864357 Share on other sites More sharing options...
natepizzle Posted June 26, 2009 Share Posted June 26, 2009 If he is just wanting to put the design of the site into a single place so that changes reflect over every page include would work just fine. template page design Quote Link to comment https://forums.phpfreaks.com/topic/163819-need-to-learn-about-php-templating/#findComment-864365 Share on other sites More sharing options...
webref.eu Posted June 27, 2009 Author Share Posted June 27, 2009 If he is just wanting to put the design of the site into a single place so that changes reflect over every page include would work just fine. Thanks for your comments. I am already using includes with a template-page.php file, and I save the file in a different name each time I need to make a new content page. However, if I then make a change to template-page.php, I then need to go back and update all the other pages. I need it so that if I change the template, all the pages based on the template are automatically updated. Any more comments anyone? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/163819-need-to-learn-about-php-templating/#findComment-864552 Share on other sites More sharing options...
trq Posted June 27, 2009 Share Posted June 27, 2009 There is no templating system built into php. Without knowing how your system works we can't really be of much help. Quote Link to comment https://forums.phpfreaks.com/topic/163819-need-to-learn-about-php-templating/#findComment-864556 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.