Re: Var Templates
| From: | Tom Sommer | Date: | Wed, 16 Apr 2003 20:32:42 +0000 |
| Subject: | Re: Var Templates | ||
| References: | 1 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-1207@lists.php.net to get a copy of this message | ||
On Wed, 16 Apr 2003 13:22:05 -0700 (PDT), Boots wrote:
> I'm not trying to give you a beating!!
That comment was not directed at any single individual :)
> I checked your actual suggested problem and you have to admit that that
> is EXACTLY the type of thing that config files are NOT meant to handle
[SNIP]
> Indeed. You may have noticed that I'm not really a big fan of config
> files. That is because they require a seperate class for access, are
> not compiled, and then require a very different syntax to access their
> variables from within templates. Furthermore, as you argument rallies
> against, they are completely static (which can also be argued as a
> virtue).
I completely agree, config files have always been static, but I've come to
a point where that is not enough. I realize that my request sort of breaks
everything about config files being static.
> That's why I've been leaning towards suggestions that attempt to unify
> config files with templates.
I have no problems with that, you might as well scratch everything about
config files and rather call them "pre-defined variables in a file". All
this would require is implementing my idea (roughly) :)
> Perhaps there are other ways this can be addressed, for example, with a
> new template block {config}{/config}. This block can be made to work
> just like config files except, as a template function, would also
> permit for standard template functionality. Or perhaps the existing
> inline {php} in templates is sufficient (yuch).
No, bad idea
> Sometimes it is
> just as easy to change the design of your code as it is to say that
> your code won't work because Smarty doesn't do such and such.
Yes, I know... but my idea is clever, it's all in here *points at head* :)
> xo boots
> PS. By I disagree that using templates to assign vars (via eval) is any
> more expensive than config files; however, straight PHP is the least
> expensive thing you can do here and probably the most "correct",
> whatever that means.
Which is why we have pre-compiled templates *drools*
Anyway, we can babble about this all day, it's basically not going to
change anything (since we don't develop smarty) or solve my problems, which
I am slowing giving up any hope of solving my-way.
--
Tom Sommer, Denmark
www.tsn.dk - www.dreamcoder.dk