RE: [PHP] Seperating presentation from logic

From: Date: Wed, 26 Jun 2002 02:56:50 +0000
Subject: RE: [PHP] Seperating presentation from logic
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-103890@lists.php.net to get a copy of this message
Hi I have been experimenting using xhtml as the source and using the DOM XML functions to manipulate it and outputting html. You can do things such as adding rows to tables and items to drop down lists. By putting id="foo" in the xhtml tags you can locate it using xpath. One advantage is you can drop whole tables or any specific tag if they are not needed and can do things like back fill columns in tables that are difficult in normal html when you need to know the data before you have it. I have done a class for it but its in early stages :). It is looking very promising as a template system. One thing is the xhtml has to be syntax perfect :) Tom At 11:50 AM 25/06/2002 -0700, Jerome Houston wrote:
Is there a particular reason everyone is skipping over the idea of using XML/XSLT? What you're talking about is EXACTLY what XSLT was designed for. You can write scripts that access the DB, and output XML. Then you just use XSL files written by your designers to translate your XML into HTML. they get to choose EVERYTHING about what the page looks like. Granted, your designers need to learn a little XSL, but it sounds like, for what you're doing, they wouldn't need to learn much. If you're going to teach them to use something proprietary like pattemplate (as mentioned below), why not spend that time teaching them to use XSL, which is easy to use and isn't proprietary, it's actually W3 specified. for info on how to get it working with php, go to: http://www.webmasterbase.com/article/602 some people may disagree. -jerome
Basically, like someone else said, you teach your HTML designers to use custom tags that your template engine will recognize and place the correct values for. To make a loop, you'd tell your designers to do something like this <table> <pattemplate:loop> <tr><td><a href='{download_link}'>{filename}</a></td></tr> </pattemplate:loop> It's not exactly like that, mind you, but you get the idea. You can't ever completely separate you designers and programmers. What you do is provide an easy to understand way for your designers to include the programming elements. What's easier, teaching them to put <?=$_POST['name']?> or {name} in the document???
_________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.general (#103890) next »