Nightfire
09-25-2003, 04:04 PM
class pages{
var $titles = array("index" => "Welcome",
"credits" => "Site credits");
function page_title($which){
return $this->titles[];
}
}
echo '<html><head><title>'.$pages->page_title("index").'</title></head></html>';
This is my first attempt at OOP and I have no idea why I'm not getting anything in the title of the page. I've not used functions or arrays for ages, so I'm guessing it's something to do with them too. Any ideas?
var $titles = array("index" => "Welcome",
"credits" => "Site credits");
function page_title($which){
return $this->titles[];
}
}
echo '<html><head><title>'.$pages->page_title("index").'</title></head></html>';
This is my first attempt at OOP and I have no idea why I'm not getting anything in the title of the page. I've not used functions or arrays for ages, so I'm guessing it's something to do with them too. Any ideas?