Re: [NEW EXTENSTION]: templates

From: Date: Wed, 05 Dec 2001 14:35:26 +0000
Subject: Re: [NEW EXTENSTION]: templates
References: 1 2  Groups: php.dev 
Request: Send a blank email to php-dev+get-72597@lists.php.net to get a copy of this message
> I am fairly sure that someone will come up with the wish to make > the {}'s surrounding the name of the template tag configureable. > You may be tempted to provide a PHP function > template_set_braces() > or something like that to implement this. Don't. This is already done in tmpl_open() function. You may pass an array with template tag delimiters and context name. > Finally, do NOT implement conditionals or loops. If you give in to > anything that resembles control structures, you'll end up creating > a turing complete language. This will sooner or later become a PHP- > within-PHP and you'll want to avoid this at all cost. Conditions and > loops must always be part of the controlling PHP code, never be part > of the template. If a particular application does lend itself well > to this kind of structure, then this particular applicastion maybe > isn't properly structured for templates to be useful. Use pure PHP > then. Agree. That's exactly what I've been thinking. Actually, I believe that functionality that we have now, is enough for almost any kind of task when working with templates. If you don't want a tag to appear, just do not assign any value to it. I suppose, we can consider this as the simplest conditional, so there's no need for anything else. Maxx

« previous php.dev (#72597) next »