haha.
It wasn't slight.
It was more like a few shots, a half gallon of wine, and two tall cans.
I had a page, index.php. It created the page, most importantly, two objects.
Code: Select all
index.php
obj $DatabaseLayer
obj $PageBuilder
/* I wanted these to both be global, which is why I declared them both in that page, I had hoped that everything down the line would be able to use them. So I was stuck here, where I had a something that looked like this */
index.php
obj $DatabaseLayer
obj $PageBuilder
func $ShowPage
include(menu/$current_page.php)
call $DatabaseLayer->DbQuery('sqll string', array('vals'))
include($current_page.php)
// functions that show the page
The menu page would die at that call to that function without an error message. I tried a million different things but yesterday I made it work by declaring an instance of $DatabaseLayer inside $PageBuilder and then using $this->DatabaseLayer->DbQuery('blah')
It probably sounds stupid but I was friggin stuck! I just wanted the dang thing to be globally accessible.