jmDesktop wrote:
Hi, I was using .net and it uses templates. I like that it did not
mix the UI with logic. I saw there are many templating engines for
php usage. Can you recommend one? I don' t know which to pursue. I
don't need MVC at the moment, but I don't know that the templating
engines require it either.
I've always rolled own out of a couple of regexes.
The tags are just name/value pairs and I make an associative array
($EDIT_TAG) out of them.
If I find a match for something in the library I return the code for
that match, otherwise I do this:
global $CUSTOM;
if((isset($EDIT_TAG['mode']))&&($EDIT_TAG['mode']=='custom')){
if(function_exists($CUSTOM[$EDIT_TAG['name']])){
return $CUSTOM[$EDIT_TAG['name']]($this,$EDIT_TAG);
}
}
I'm a relative newcomer to php, so that's not the best coding.
That's completely flexible. I can read instructions from the tag,
read instructions from the query string, if it's in my CMS, I have the
page path in $this. I can print static pages (which I do for the CMS) or
just spit it back out. I can mix CMS and database output.
I suppose if I had ever gotten through reading someone elses template
engine, I'd use that. But this makes it easy for me to use the same
template for all my needs. If the design changes, I only need to change
the template.
Jeff
>
Thank you.