Re: [SMARTY-DEV] variable object referencing

From: Date: Mon, 10 Feb 2003 17:59:05 +0000
Subject: Re: [SMARTY-DEV] variable object referencing
References: 1 2  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-675@lists.php.net to get a copy of this message
Thats what I needed, I knew it was simple. I thought I tried that but must have hosed it with an extra '$' or something. tnx Monte On Mon, 2003-02-10 at 11:52, M Mohr wrote: > On Mon, Feb 10, 2003 at 11:34:18AM -0600, Monte Ohrt wrote: > > There's a problem with supporting this syntax: > > > > {$foo->$bar} > > > > Pre 2.4.0, the compiled template would look like this: > > > > <?php echo $this->_tpl_vars['foo']->$bar; ?> > > > > But, since $bar is an assigned value and we don't extract them anymore, > > the engine tries to compile to this: > > > > <?php echo > > $this->_tpl_vars['foo']->$this->_tpl_vars['bar']; ?> > > > > Notice the syntax problem, PHP does not like it. Maybe I'm missing > > something easy, but is there a way to make this work? > > php would definately like > echo $this->_tpl_vars['foo']->{$this->_tpl_vars['bar']}; > but unfortunately not > echo {$this->_tpl_vars['foo']->{$this->_tpl_vars['bar']}}; > > i don't know if that helps > > greetings > messju > > > Monte

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