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?