Template path including '.'?
| From: | Mark Rogers | Date: | Tue, 23 Dec 2003 13:06:50 +0000 |
| Subject: | Template path including '.'? | ||
| References: | 1 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-2010@lists.php.net to get a copy of this message | ||
I'm having some strange problems which seem to be template path related, but
I'm not sure if it's me or Smarty. Consider the following (/www/htdocs is
the server's DocumentRoot):
/www/htdocs/contact.htm
..
$smarty->assign('body', 'contact.htm');
$smarty->display('default.tpl');
/www/templates/default.tpl
..
{include file=$body}
/www/templates/contact.htm
Hello World!
This work's fine; the PHP code in the first contact.htm causes Smarty to
display my template default.tpl, which in turn includes the contact.htm in
my templates directory. (Obviously, /www/templates is in my Smarty
$template_dir path setting.)
However, if I delete the contact.htm from /www/templates, instead of
complaining Smarty uses contact.htm from /www/htdocs, ie the PHP source
code.
It looks as though Smarty is looking in the "current" (ie script) directory
for templates, but I can't see where in the code this is happening.
(/www/htdocs is not in Smarty's template path.)
Is this a bug, or is it me making an idiot of myself?
This is with 2.6.0-RC2.
--
Mark Rogers,
More Solutions Ltd