class config {
public $pageName;
function __construct($pageName=''){
$this->pageName = $pageName;
}
}
class header extends config {
function display(){
echo parent::$this->pageName;
}
}
$config = new config('Home Page');
$header = new header();
$header->display();
This doesn't display anything, I thought it should have displayed 'Home Page'.
Any idea how i can achieve this?