Some argue that getting your templates from a database might slow down your site, as well as adding the overhead of having to open a database connection. However, if you're using a PHP/MySQL driven site, you probably already have a open database link, so a few extra queries won't slow down your small site much. This tutorial will consist of two files, template.php and index.php. The first will have just have a few common functions (we could include these in index.php, but I prefer to separate function definitions from normal code). And the latter file, index.php, will connect to the database, and display the templates, amongst other things. When the code is finished, I should be able to have a page like this on my site:
Ok, now we know what we want, let's get this show on the road!
blog comments powered by Disqus |