Update:Archive/2.0/Developers/Templates: Difference between revisions

Jump to navigation Jump to search
no edit summary
mNo edit summary
No edit summary
Line 5: Line 5:
http://www.sitepoint.com/forums/showthread.php?threadid=123769
http://www.sitepoint.com/forums/showthread.php?threadid=123769
http://wact.sourceforge.net/index.php/TemplateView
http://wact.sourceforge.net/index.php/TemplateView


A template engine for the web should meet certain criteria. For me, this criteria is the following:
A template engine for the web should meet certain criteria. For me, this criteria is the following:
Line 16: Line 15:
6. Secure.
6. Secure.
7. Flexibility.  
7. Flexibility.  
=== morgamic's take ===
A solid application structure could eliminate the need for a comprehensive templating engine.  Wrapping HTML output is a relatively simple task done by using includes in parallel with proper use of CSS.  I always question templating that extends beyond that in terms of complexity.
As with PEAR::DB or adodb, I think the use of a templating engine should only be considered if it is the right thing to do.
That said, I question whether adding the layer of complexity and adding another dependency is really necessary if we can use CSS for all of our presentation.
Don't get me wrong -- I'd definitely like to se HTML wrapped in functions where appropriate and a good segregation of PHP and HTML in order to have some sort of uniformity and structure when it comes to each .php script.  I think that is a great goal and should definitely be realized in any good application.
But if we can use CSS properly, all HTML output will be exactly the same with the exception of DOM identifiers when appropriate, using templating or skinning the whole app should be reduced to a matter of switching stylesheets.  From there, it's just a matter of packaging your markup properly, which is not something I see us needing a separate tool for.


<pre>
<pre>
83

edits

Navigation menu