Re: Re[2]: Passing in objects by reference (Pull approach w/ Smarty)
| From: | Monte Ohrt | Date: | Fri, 06 Jul 2001 15:52:20 +0000 |
| Subject: | Re: Re[2]: Passing in objects by reference (Pull approach w/ Smarty) | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-1129@lists.php.net to get a copy of this message | ||
Andrei Zmievski wrote:
>
> On Fri, 06 Jul 2001, Monte Ohrt wrote:
> > > > {$tickers->fetch("YHOO")}
> > > > Stock Name: {$ticker_name} Stock Price: {$ticker_price}
> > > >
> > > > (Tickers::fetch, in this case, assigns template variables using the
> > > > Smarty API).
> > >
> > > I think you can already do this. If you assign $tickers to a template
> > > and it's an object you can do:
> >
> > $tickers isn't an assigned template variable, fyi. It is an object in
> > PHP.
>
> Of course it is -- if you assign it:
>
> $tickers = new Tickers();
> $smarty->assign('tickers', $tickers);
>
In your example:
{php}
$tickers->fetch("YHOO");
{/php}
It is not a template variable, and doesn't need to be.