|
Posted by Jeff Schmidt on 10/11/05 07:12
Hello,
I've been toying around, lately, with using PHP's DOM API
(specifically, domxml because I'm still using PHP4) for doing some of my
server side dynamic pages, instead of the 'classic' method of outputting
a serial stream of html dynamically generated with, e.g. php print()
statements. The reason this is attractive to me is that,
programmatically, it makes it easier to seperate logic from
presentation. I realize that PHP has available, through PEAR and
otherwise, various templating systems that attempt to address that need,
but I've found some of the templating systems, at least, to be somewhat
confusing, whereas the DOM seems pretty straightforward to me.
But, I've wondered about the performance implications of my would-be
method. Namely, I would normally start by reading in an html 'template'
file with the function domxml_open_file, modify it to my hearts content
with DOM methods, and then use DomDocument->html_dump_mem() to
re-serialize the html and send it to the web-browser.
Is this horribly inefficient, or just a small, reasonable overhead?
Navigation:
[Reply to this message]
|