| Creating Your First Template Driven PHP Website Part 1 - Page 3 |
|
|
|
| Written by Handy PHP Administrator | ||||||||
| Monday, 23 April 2007 15:48 | ||||||||
Page 3 of 3
Using all of the same files as before except the index.php file we can create additional content pages like so: content1.php Sample 2 CODE: content1.php
<?php
$site_title = "My Website"; $page_title = "Sample Template Content Page 1"; $main .= "<div style=\"text-align:left; margin:10px;\">Here I can place any kind of content I want. By using a template and a few static content files with each page of my website, I can quickly add, reformat, update, or otherwise modify the content on my website.</div>"; require('header.php'); require('main_menu.php'); require('footer.php'); require('template.php'); ?> The file above would output the following when used with the files specified: This is a different page than index.php but was created the same way. This means that the website is static in that the pages are put together using direct data. No manipulation of data has occured and the pages are dumb in nature. Dynamic content can be easily added to the website at this point on a limited basis since the use of a template and modules allows information from one file to influence information in another file.
Using this method of templating will provide you with a quick and easy website or can be used as the means by which you convert your pure HTML website to PHP. For more information on converting yout HTML website to PHP, you may find this article helpful: Converting HTML to PHP Basic Tutorial. Additional tutorials regarding this topic will follow soon.
|
||||||||
| Last Updated on Friday, 02 October 2009 21:25 |







