Re: templating engine options

From: Date: Sun, 24 May 2009 21:45:19 +0000
Subject: Re: templating engine options
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-293086@lists.php.net to get a copy of this message
At 1:54 PM -0600 5/24/09, LinuxManMikeC wrote:
You're missing the point just because he threw in some old HTML styling attributes. The main issue is the overhead of added parsing layers to find where content goes in the HTML.
I may be missing the point, but I know where content goes in my scripts and I do that without any parsing. I've reviewed dozens of projects that use templates and have not found a single one that considers the separation of languages as it should. As I've said on the css-discuss list many times (they don't like to hearing it) but no web language operates in a vacuum. If you are programming for the web and creating web pages and applications, then you had better understand how all the different web languages fit together in current and best practices or you'll just be generating shortsighted code. It will be just someone else's problem later to deal with.
Aren't we already using a language (PHP) that parses for place holders for dynamic content within HTML tags?
No, I use php/mysql to pull the data I need and assemble the html to hold the data where I want it. From there, I use css to make the presentation and javascript to handle user enhancement. I don't see where templates help matters much -- especially when most of them use embedded styling elements such as the font tag for God's sake - that's a giant step backwards.
Write the template in XHTML, style it with CSS, and insert content place marks with PHP short tags. Do the programming work of calculations, validation, and DB access in another script which will include the template at the appropriate time. Even create classes to hold various data sets (think JavaBeans) if you want. Adding a layer of abstraction just so your designers don't have to write <?=$var?> is silly at best. At lest that's my opinion. Do whatever works for you.
I do what best works best for my clients*. If you are writing XHTML, then using <?=$var?> won't work -- did you know that? That's akin to using a font tag -- it's been outdated and the reason why I said above use "best practices". Additionally, my designers design -- I assemble their designs into functioning web pages and applications. I see no need for any designer to ever worry about embedding html, php, mysql, javascript, css or any other web language into my work. They design and I program -- that's the layers of abstraction I deal with. Cheers, tedd * Granted, sometimes I have clients who won't allow me to do what's best for them because they know programming much better than I -- they just have me program because they don't want to waste their time doing such low level stuff. Hey, it pays the same as the high level stuff. :-) -- ------- http://sperling.com http://ancientstones.com http://earthstones.com

« previous php.general (#293086) next »