Jump to content

Need to learn about PHP templating


webref.eu

Recommended Posts

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.

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.