Re: [SMARTY-DEV] variable object referencing

From: Date: Mon, 10 Feb 2003 17:52:08 +0000
Subject: Re: [SMARTY-DEV] variable object referencing
References: 1  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-673@lists.php.net to get a copy of this message
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 (#673) next »