Home arrow PHP arrow 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.

  1. Building a Site Engine with PHP, Part 4
  2. Youíve been Tagged
  3. Give it a Little Class:
  4. The Final Words
By: James Murray
Rating: starstarstarstarstar / 24
July 12, 2004

print this article



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.

>>> More PHP Articles          >>> More By James Murray

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates


Dev Shed Tutorial Topics: