webguy262 Posted May 4, 2011 Share Posted May 4, 2011 I have a class that creates a grid from an xml feed. The class file is attached. The grid displays on a page which is defined within the class as follows: private $results_page = '/foobar.php'; I'm including the same class in multiple folders (the folders are addon domains) so I can have just one copy of the class so it is easy to modify. The problem is that I need to add a variable containing the folder name to the $results_page path, so that when the class executes within each folder, the $results_page is 'FOLDER//foobar.php' I have a file with defines in each folder, and I have tried including that file in the class and using the defined var in the construct, but I can't get it to work. What am I missing? [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/235503-using-a-variable-in-a-class/ Share on other sites More sharing options...
vicodin Posted May 4, 2011 Share Posted May 4, 2011 Im guessing you didn't write this your self? Not taking a shot at you but I need a bit more knowledge of how this class works and what its supposed to do so I can try to help you. Can you give us as much info about it as possible? Quote Link to comment https://forums.phpfreaks.com/topic/235503-using-a-variable-in-a-class/#findComment-1210392 Share on other sites More sharing options...
webguy262 Posted May 4, 2011 Author Share Posted May 4, 2011 The class makes a soap call to get an xml feed and then creates a grid showing the data. I did not write the application, I'm just trying to adapt it for use with multiple sites. I could put a copy of the class file in each domain folder, but I prefer having one copy of the file to make modification easier. On the designated $results_page, the class file gets called as follows: <?php include('../classes/class.grid.php'); $grid = new grid(); print $grid->displayEventByEventIDInteractive($_GET['eventID']); ?> Quote Link to comment https://forums.phpfreaks.com/topic/235503-using-a-variable-in-a-class/#findComment-1210400 Share on other sites More sharing options...
vicodin Posted May 4, 2011 Share Posted May 4, 2011 Ok, makes more sense now... Now why do you need a variable to the results page when it seems the results page is whats executing this class? Quote Link to comment https://forums.phpfreaks.com/topic/235503-using-a-variable-in-a-class/#findComment-1210404 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.