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

Including PHP fatal error

 
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
GeXus
Smarty Rookie


Joined: 16 Aug 2006
Posts: 28

PostPosted: Sat Apr 28, 2007 4:00 am    Post subject: Including PHP fatal error Reply with quote

I'm including a php file (inside a template) that is displaying a template. I am using include_once and making sure that smarty is not set twice. But no matter what I keep getting

Fatal error: Call to a member function assign() on a non-object


Any ideas why I would get this? Why would smarty not be initialized? If I go to the included php file directly, it works fine.. just not as an include.

Thanks for you help!
Back to top
View user's profile Send private message
czarnowski
Guest





PostPosted: Sun Apr 29, 2007 11:34 am    Post subject: Reply with quote

You should do this:

{include_php file='test.php' assign='testvar'}

the output of test.php was captured in testvar, and than ypu can use $testvar.
Back to top
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