Re: [SMARTY] Smarty and directory layout
| From: | Bertrand DUNOGIER | Date: | Fri, 31 May 2002 06:27:23 +0000 |
| Subject: | Re: [SMARTY] Smarty and directory layout | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-4475@lists.php.net to get a copy of this message | ||
MS> This is where Smarty gave me hell. Things broke immediately as
MS> soon as I separated the directories and tried to hack around
MS> Smarty source to understand the logic by which Smarty uses
MS> directories.
I'm not sure I understand your problem perfectly, but it sounds pretty
trivial to me: all you want is to be able to have Smarty, templates,
compiled templates, cache and scripts anywhere on the server, right ?
It was what i have. For a particular website, I've got a
/home/www/sites/sitename/ directory. In this directory are several
sub-directories:
html (the document root)
templates
phpdata/templates_c
phpdata/cache
...
(include_path is used so that there is nothing to change when you move
these directories)
Smarty is located in /usr/local/lib/php/smarty-templates/, and is used
from that location by several sites.
At the beginning of my auto_prepend file, i create my Smarty instance,
then set the class parameters i need to change:
include 'Smarty.class.php';
$tpl = new Smarty;
$tpl->template_dir = $smarty_templates;
$tpl->compile_dir = $smarty_templates_c;
$tpl->cache_dir = $smarty_cache;
the $smarty_* variables were set in my config.php file.
Smarty's files location does not change anything, as long as
include_path is used...
Hope it helps.
Bertrand