Re: [SMARTY] How can get template_dir in template file

From: Date: Mon, 11 Oct 2004 00:12:01 +0000
Subject: Re: [SMARTY] How can get template_dir in template file
References: 1 2 3  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-11872@lists.php.net to get a copy of this message
I normally use my own extended class to Configure and access Smarty. I'll recommend you do the same and assign any var you need in the constructor or other functions. i.e. class MySmarty extends Smarty { /** * Constructor PHP 4 */ function MySmarty() { $this->template_dir = '/home/site/smarty/templates'; $this->Smarty(); // You could do something like that: $this->assign('smarty_tpl_dir', $this->template_dir; } Hope this could give you any ideas. Best regards, Jordi On Sun, 10 Oct 2004 18:42:39 +0800, srni@gzlinux.org <srni@gzlinux.org> wrote: > I take it for granted that there is some smarty build in method :) > > > $smarty->assign('tpl_dir', $smarty->template_dir); > > then you can do what you want with {$tpl_dir} > > > > If you need something more live, either assign by a reference, or else > > write a plugin to fetch it. > >

« previous php.smarty.general (#11872) next »