Robert Cummings wrote:
On Wed, 2009-03-04 at 18:01 -0800, Michael A. Peters wrote:
Robert Cummings wrote:
On Wed, 2009-03-04 at 15:21 -0800, Michael A. Peters wrote:
Robert Cummings wrote:

To punt what is repeated over and over during runtime to a single
compilation phase when building the template target. To simplify the use
of parameters so that they can be used in arbitrary order with default
values. To allow for the encapsulation of complex content in tag format
that benefits from building at compile time and from being encapsulated
in custom tags that integrate well with the rest of the HTML body.
I can't speak to those (and I have no opinion on template systems having never used any of them.

remove the necessaity of constantly moving in and out of PHP tags.
php does not require that you constantly move in and out of PHP tags.
There's at least one and possibly several pure php solutions that allow one to never write a line of html but get beautiful dynamic html output.
It doesn't require, but if you're not moving between them, then you're
probably echoing your HTML, and that can be a maintenance nightmare.
echoing html involves mixing html and php.
Using an XML class (like DOMDocument) to build the document does not.

So you punt the entire rendering of the HTML content to run-time
execution one node at a time?


This is what I do.
I create the nodes as needed and add them to the parent nodes when I'm done with them - and when the document is finished, add the various content nodes to the body node, body/head nodes to html node, and then use saveXML(); to get the output as x(ht)ml to send to the browser.

If that's what you described then yes. Otherwise, then no - it's not.

some example, IE to build my form -

$xmlForm = $myxhtml->createElement("form");
if ($multipart > 0) {
$hiddenDiv = $myxhtml->createElement("div");

// etc ..

if(isset($imgref)) {

if ($museum == 1) {
   if (isset($validarray['museum'])) {
      } else {
if ($editrecord == 1) {
if (isset($validarray['species'])) {
   } else {


$submitDiv = $myxhtml->createElement("div");

$submitInput = $myxhtml->createElement("input");


The various requires are files that create various parts of the form. They are in individual separate files because some of them are used in other forms and I don't like to have replicated code that is functionally equivalent.

hiddenInput is a simple function I wrote that returns an input node of type hidden - which I can (when needed, IE if I want to add an id tag for javascript hook) I can continue to modify.

function hiddenInput($document,$name,$value) {
   $input = $document->createElement("input");

Does that answer your question?

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to