Basically, I set a variable called $nf_listing, which is an object of a particular class. I have functions that declare the variable like "global $nf_listing", and then run various methods on that class. Kinda like WordPress, if you guys have used that.
My problem is, the functions aren't recognizing the global variable as being set. Here's my code:
Code: Select all
while(has_results()) :
$nf_listing = create_object();
endwhile;
require ROOT_DIR . "/includes/functions-internal-event.php";
require ROOT_DIR . "/includes/functions-display-event.php";
require ROOT_DIR . "/includes/functions-internal-venue.php";
require ROOT_DIR . "/includes/functions-display-venue.php";
require ROOT_DIR . TEMPLATE_DIR . '/event.php';Example function in functions-display-event.php:
Code: Select all
function event_title($link = TRUE) {
global $nf_listing;
$nf_listing->event_title($link);
}