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

include_php - missing variables from classes

 
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
saitho
Smarty n00b


Joined: 27 Jul 2015
Posts: 2

PostPosted: Mon Jul 27, 2015 8:05 am    Post subject: include_php - missing variables from classes Reply with quote

Hi,

I'm including filea.php using {include_php} into my template. This file however also includes config.php which requires a database class and establishes a connection to the database as $db.

The $db from config.php however is not passed over to filea.php, even though it should. Other variables work fine.

Do you have any suggestions on how to fix that problem?

Thanks Smile
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Mon Jul 27, 2015 6:20 pm    Post subject: Reply with quote

Solution: Don't include PHP code into your templates.
Back to top
View user's profile Send private message
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