HomePHP Page 4 - Building a Site Engine with PHP, Part 4
The Final Words - PHP
In the last three articles we went over a basic idea of how a site engine works, how to build the plug-in, module, and block systems, the basic directory structure, the database structure, and the authentication methods. In this, the fourth article, weíll be going over the template system, and the basic page loading methods. So, letís go ahead and get started.
Itís not hard to create your own tags; all you have to do is send them to the array of tags. Hereís a small example, if you wanted tags that will show the date and time -- all youíd have to do is put in the following code, after youíve declared the template class.
$template->tags['date']=date("l F, j Y");
Then anywhere you have the tag that looks like <!date>, it will show the date like this: Thursday June, 10 2004, and the <!time> tag will show the time like this: 2:17:04pm. On top of that a tag can show anything -- a tag can be an include, a string, even an image. For example, if you do this $template->tags['test']="foo"; the tag <!test> will show the word ďFooĒ. Itís pretty cool if you ask me.
To add columns to your layout, all you have to do is add them to the template file named column4, column5 and so on.
Well thatís about it for this article. In the fifth and final article Iíll show you what you need to do to add plug-ins , modules, and blocks to the engine.