For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > October 2004 > Re: [SMARTY] How can get template_dir in template file









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

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

2004-10-10, 8:56 pm

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:
[color=darkred]
> I take it for granted that there is some smarty build in method :)
>
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com