Re: [PHP Template] Revised proposal

From: Date: Wed, 16 Feb 2000 22:43:38 +0000
Subject: Re: [PHP Template] Revised proposal
References: 1  Groups: php.template 
Request: Send a blank email to php-template+get-92@lists.php.net to get a copy of this message
1) I still like "{{" better than "{" so people won't have to escape single curlies. 2) I think there are issues with include. Suppose that: designer creates template a. developer writes code to load and fill in vars for template a. designer (or someone) later includes template b from template a. template b has variables not filled in by code. This is broken. I suppose the same is true if designer goes back and adds a random new var to template a, but it just seems problematic to me. Another thing is the issue of how to specify the include files. Is the path relative or absolute? Should absolute paths be allowed? If relative, is it relative to the current template or to the current request? I would tend to say that it should be relative to the parent template, or if absolute, then that is relative to doc_root, not file system root. 3) The if statements all assume scalar values for variables. I assume this would work in a looping construct -- it would simply operate on the index currently be processed. 4) still not convinced of need for config vals. Why couldn't PHP code load any needed values and fill them into the regular vars? 5) I think that tpl_hide (clear) is a useful API. 6) There should probably be a tpl_addval() API for adding a new value to a non-scalar variable. useful for looping when you need to rearrange an array, eg: $people = array(array("dan", "libby"), array("andrei", zmievski)) while(list($key, $val) = each($people)) { tpl_addval("fnames", $val[0]); tpl_addval("lnames", $val[1]); } 7) I think that tpl_getvars() is useful so you can determine if a particular value has been set or not. -dan Andrei Zmievski wrote: > I've revised the PHP Template Engine proposal according to some of the > discussion that went on yesterday. Please look through it again, and > let everyone know your thoughts. > > http://va.php.net/~andrei/tpl-engine.txt > > -Andrei > * Entropy isn't what it used to be. *

Attachment: [text/x-vcard] Card for Dan Libby danda.vcf
« previous php.template (#92) next »