Re: templates?



Some do not have a specific language so you cannot do complex things.
For example it's not easy to display a table (sometimes you need to have a specific template to display the TR HTML tags...).
, it's not easy to use a different color to display a table row according to a parameter etc etc


Some have a specific language, like Smarty.

My question is, what is the interest to learn another language??
What is the real interest of Smarty (or other one)?

For me I have always considered this a loss. Why add another language ontop of PHP? To me I think it is easier to have PHP just render everything instead of having to learn more templating languages.


The only thing I use templates for currently is a custom made XML based system. Takes the sections of an XML document combines them and then parses using PHP.

All variables are exported to that template so then you have a set of like 5 variables for that page. So therefore all the main logic is contained in its pure PHP form and then the templates are seperated but the variables remain the same.

Ex:
each page calls index.php which checks account validity, session, and template file to include. Runs through the build process if there isn't one in the cache or if there is an updated file.


now the file is build and cached, it is now included and all the variables are extacted to that file. Now I simply use PHP. This saves rendering time, also while teaching the web designer fundimental programming. (He is only going to be working with simple items)

Mike
.



Relevant Pages

  • Re: New template engine - retry
    ... is an improvement over Smarty (and the other, newer, template engines ... than other template systems. ... There are two central points where I believe mplate is different from ... other PHP template engines. ...
    (comp.lang.php)
  • Re: [PHP] Pure PHP
    ... I want to write some of my ideas about php performance and maintenance. ... you may consider this response to Robert's template systems arguments. ... Fortunately it's my own tag implementation ... If you got lots of read sql operations and if the data can store in php array. ...
    (php.general)
  • Re: New template engine - retry
    ... is an improvement over Smarty (and the other, newer, template engines ... tell me why you think this template is better ... There are two central points where I believe mplate is different from ... other PHP template engines. ...
    (comp.lang.php)
  • Re: A better XSS trap (Feedback wanted)
    ... better to always be forced to choose the right filter depending on the ... It makes template code shorter, ... and easier to understand for non-programmers (doing the HTML design). ... I personally stick to PHP only, because the I gain of a template engine ...
    (comp.lang.php)
  • Anti Anti-Template Commentary :)
    ... One of it's large claims is the overhead of the template ... First off I'd like to agree that PHP "can" be used as a templating ... (often jumped through for you by Smarty or InterJinn, ... interjinn I also supply very limitted conditional tags (I created a tag ...
    (php.general)