Not able to find the class.
Posted: Fri Nov 09, 2007 6:24 am
I have a problem with a class that i just not can figure out.
for some reason it won't load a global variabel in a class
index.php
The class.news.php
This outputs.
As you can see dose it load the class fine in the index file, but it is not able to gloalise it inside the news class. and i just don't understand why 
Can one help me with the problem?
for some reason it won't load a global variabel in a class
index.php
Code: Select all
require_once(PATH_MODULE."news/class.paging.php");
require_once(PATH_MODULE."news/class.news.php");
$pg = new paging(2);
var_dump($pg);
$nw = new news();Code: Select all
class news {
public function news()
{
global $pg;
// This list an array of the news to an $this-> var
var_dump($pg);
}
}Code: Select all
object(paging)#5 (4) { ["limit"]=> int(2) ["tp"]=> string(1) "8" ["pages"]=> int(0) ["menu"]=> string(0) "" }
NULLCan one help me with the problem?