Re: Var Templates

From: Date: Wed, 16 Apr 2003 19:40:36 +0000
Subject: Re: Var Templates
References: 1  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-1203@lists.php.net to get a copy of this message
On Wed, 16 Apr 2003 11:58:54 -0700 (PDT), Boots wrote: > Tom, I still think your example suggests a standard template treatment: > config.tpl > --------------- > {assign var=value1 value=hello $myvar, welcome} > usage.tpl > --------------- > {include file=config.tpl} Then why do we even need to have a config file class? > After all, what you are asking > for is really an indirection around the simplest possible PHP code of > all: > $myvar = 'test'; > $var1 = "hello $myvar welcome"; Yes, try and do that in smarty with config vars, that's my problem... > If you MUST have it templated, how about this: > config.tpl > ------------------- > $var1 = "hello $myvar welcome"; > config.php > ------------------- > $smarty->assign('myvar', 'test'); > eval($smarty->fetch('config.tpl')); Then why do we even need to have a config file class? Plus that's not clever performance-wise BTW, "hello..." thing was just an example, I posted the actual problem here: http://lists.php.net/article.php?group=php.smarty.dev&article=1196 > You see, I'm not trying to say you don't have a valid need; I'm not saying you were :) > I'm suggesting that there are already plenty of ways to get to where you > want to go without changing anything in the core or introducing any new > concepts. I am basically stuck after coding some 40 PHP files and templates because of this. I am also looking for the best way to do this, without 1) Modifying smarty myself (would make CVS updates a hell) 2) Loosing performance 3) Keeping everyone happy, which seems to be hard since I'm taking a beating here :) > Good luck and have fun! Thank you :) > ps. I liked your freudian slip: "backtrics" :) He he :) My spelling is not at it's best, as you might have noticed :) -- Tom Sommer, Denmark www.tsn.dk - www.dreamcoder.dk

« previous php.smarty.dev (#1203) next »