|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
mistermikeb Smarty n00b
Joined: 30 Oct 2003 Posts: 2 Location: London
|
Posted: Thu Oct 30, 2003 5:09 pm Post subject: problem with including php |
|
|
Hiya, Ive had a search and can't find the answer so if someone could help it would be much appreciated....
I have some php which does an include, ie
Code: | include("myphppage") |
inside that included page, I have the following
Code: |
<?php
//smarty call - open mail success page
require('mbSmartyRenderer.class.php');
$mbsmarty=& new mbSmartyRenderer();
$mbsmarty->display('smartySmtpSuccess.tpl');
?> |
thats all my page does
I get an error saying that smarty can't find my page smartySmtpSuccess.tpl - why should this be - all my other pages work fine, (that are'nt called from an include) but not this one - my *templates* setting is in my mbSmartyRenderer class (extended the smart one) and points to /templates - I thought templates was an absolute, and no relative paths were required?
is there a problem with including php files that call a smarty template themselves?
Any help much appreciated
mikeb |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Thu Oct 30, 2003 5:38 pm Post subject: |
|
|
"/templates" ? that's only correct if your templates directory is in the root of your harddrive-directory-structure. |
|
Back to top |
|
mistermikeb Smarty n00b
Joined: 30 Oct 2003 Posts: 2 Location: London
|
Posted: Fri Oct 31, 2003 8:56 am Post subject: |
|
|
sorry , it echoes templates, not /templates.......this is Smarty main class
Code: |
/**
* The name of the directory where templates are located.
*
* @var string
*/
var $template_dir = 'templates';
|
and its in my website as
/mytestsite/templates/ (one down from server root)
any php pages in /mytestsite work, ie /mytestsite/mytestpage.php can call a tpl file in /mytestsite/templates no problem, but not if that php page does a php include to another php page (even in the same directory) that tries to display a template..........
any ideas?
thanks,
mike |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|