RE: [SMARTY] Relative includes?
| From: | Erich Beyrent | Date: | Tue, 21 Dec 2004 13:29:53 +0000 |
| Subject: | RE: [SMARTY] Relative includes? | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-12064@lists.php.net to get a copy of this message | ||
> Hmmm the whole point is actually to have a directory hierarchy in my
project.
> I don't want to put all templates in the same directory...
>
> Well I do it like this (in my smarty-setup file)
>
> $this->Smarty();
> $this->template_dir = 'templates/'.$themedir."/";
>
> $themedir being a value passed to it.
>
> Panu
The other thing you could do is to set up a config array with all of your
template directories, and assign the entire array to smarty:
$SITE = array("themedir1" => $smarty->template_dir.'/your_dir1',
"themedir2" => $smarty->template_dir.'/your_dir2',
);
$smarty->assign("SITE", $SITE);
And access your files from this array. I use this type of setup for all of
my directories such as css, images, etc.
HTH
-Erich-