News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Michael Kimsal's Blog:
ActiveFormat idea for templating?
May 03, 2007 @ 08:41:00

There's an interesting post from Michael Kimsal over on his blog concerning an email he received from a developer over at metrofindings.com asking about the possible creation of something he called (tentatively) "Active Printers" (or "Active Formatter").

Just now I was looking at some crappy OSCommerce code, and deciding how to rip it up into a template system. And I'm talking with kyle, and the proverbial question comes up, do you give your template system objects, or strings. What if you gave it special "active record"-esque template objects. Active Printers... or something. Then you could work with everything in a consistent interface, escaping all content with htmlspecialchars if needed, etc etc. Looping through object data and making a table...

The email included a block of concept code of how he pictured it working - a pretty simple system really. Pushing data into the class and showing what tag(s) to style it with and have it "know" how to format it (like a phone number string). Michael asks his readers if they've seen something like this before.

Comments already made include discussions of things like xmlWriter, presentation and business logic, and the Savant templating library.

1 comment voice your opinion now!
activeformat template oscommerce activeformat template oscommerce


blog comments powered by Disqus

Similar Posts

Michael Kimsal's Blog: ActiveFormat idea for templating?

Alessandro Nadalin: Integrating Twig in Your Legacy PHP Code

AxisVista Blog: PHP5 DOM Based Template Engine

CodingThis.com Blog: Quick XML-to-HTML Templating in PHP Using SimpleXML

YoungCoders.com: Debunking the Bloated Smarty Myth


Community Events

Don't see your event here?
Let us know!


interview language podcast api framework opinion laravel laravel5 threedevsandamaybe unittest extension community series introduction voicesoftheelephpant symfony release version security library

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework