Quote:
Originally Posted by kgun
And so is my answer. How large do you think your content document will be once the API, is in place to be included centrally in php.ini / .htaccess or like this:
|
I bet bigger than just standard HTML templates and an awful lot more hassle to maintain than the same system using a template engine and/or something like Zend Framework, or CodeIgniter, or one of the other frameworks.
Lets put it another way why do you need an API for creating an HTML page from PHP functions at such a low level? If you provided higher level functions, lets call them widgets, then I could see the point in it as a few lines of PHP would generate all the HTML and JavaScript to provide a complex widget such as a calender along with the functionality to control it with a few simple calls.
I still don't see what "echo HTML:

('This is a static method!');" does for you. At that level you can't ask designers to build your templates you have to rather use coders.
If you look at a template engine then you have a normal HTML page with mark-up along the lines of:
Code:
... The page head HTML ...
<div id="mainarea">{body}</div>
... The page footer HTML ...
The PHP would be something like:
PHP Code:
$tpl = new template_engine('my.html');
$tpl->assign('body', 'some html');
$tpl->render();
Ok, it's overly simplified there, but the HTML can be changed on a whim and "some html" could easily be pulled from a database. You can also easily create "some html" using a WYSIWYG editor, unlike your system which would require the person editing the content hack away in PHP.
In both systems style is obviously controlled by CSS so doesn't come into the equation.