View Single Post
Old 09-25-2007, 09:51 AM   #8 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

The problem is that a "template class" is many things for many people. The requirements for a template class can vary from project to project. Because of that, it would be nice to know what you consider should be required features (and optional/nice to have features) in your "elite/1337/pro template class".

It could end up being something as simple as the following class, or 1,000s of lines of code.
PHP Code:
<?php

class Template
{
    public function 
display($szView)
    {
        if (
file_exists('views/' $szView '.php'))
        {
            include 
'views/' $szView '.php';
        }
    }
}

$tpl = new Template;
$tpl->display('example'); // views/example.php
Salathe is offline  
Reply With Quote