| xawk.com - technical wisdom served up in little slices | xawk.com -- Tags -- Php |
| ||||||||
xawk.com -- Tags -- Php -- One Line Template Engine
One Line Template Engine A One Line Template Engine in PHP This is a really clever example of using a single line of PHP to fill in a HTML template and output a web page. I found the original in the forums at http://www.webmasterworld.com/. The one line engine --
It works by finding any string starting with an opening brace and ending with a closing brace and substituting the php variable with the same name. An example of the template file -- template.tpl -- as used for this example.
This template has three variables defined -- {title}, {header}, and {text}. Using the template engine in its simpliest form.
Elegantly simple? Tags: Php Share: Del.icio.us | Digg | Facebook | Google Bookmarks | Reddit | Technorati | Windows Live | Yahoo! My Web
|
|