Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

problem with including php

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
mistermikeb
Smarty n00b


Joined: 30 Oct 2003
Posts: 2
Location: London

PostPosted: Thu Oct 30, 2003 5:09 pm    Post subject: problem with including php Reply with quote

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
View user's profile Send private message Visit poster's website
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Thu Oct 30, 2003 5:38 pm    Post subject: Reply with quote

"/templates" ? that's only correct if your templates directory is in the root of your harddrive-directory-structure.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mistermikeb
Smarty n00b


Joined: 30 Oct 2003
Posts: 2
Location: London

PostPosted: Fri Oct 31, 2003 8:56 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP