Re: sub-directories and templates

From: Date: Wed, 13 Aug 2003 05:06:52 +0000
Subject: Re: sub-directories and templates
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-10045@lists.php.net to get a copy of this message
<?php $tempsmarty = $smarty; $tempsmarty->template_dir = dirname($tempsmarty->template_dir); // same as cd .. $tempsmarty->display('templates/index.tpl'); ?> Try that Greg Chris Hubbard wrote:
All, I apologize in advance if the answer to my question is obvious. But I'm stuck... I've got the following folder structure: /var/www/ /stuff /templates /templates_c /templates /templates_c I've got php files in the root of the web site (/var/www) and in the stuff folder. The php files load smarty and then display a template. Currently I've got templates in a subfolder under /stuff, but I would rather have them in the templates folder at the root of the web site. I've tried various things like: in /stuff/index.php $smarty->display("../templates/index.tpl"); or $smarty->display("../index.tpl"); and neither works, I get an error telling me that Smarty can't find the template. Even though the path (in the first instance at least) is technically correct. so now I've got: $smarty->display("index.tpl"); which loads the template located at: /var/www/stuff/templates I want it to load the template located at: /var/www/templates Suggestions? Chris Hubbard chris@wildcharacters.com www.wildcharacters.com 425 481 2020 php based web application development Y! hoponpopontoponmoponcop@yahoo.com MSN another_ganesha@hotmail.com AIM ganeshacph


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