Jump to content

using a variable in a class


webguy262

Recommended Posts

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]

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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']);
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.