the class below is part of an mvc structure im building for my website. the class is there to produce a page if index.php is called without any request in the url. if that is good practice or not I do not know. Im new to php, and this is the first time i implement an mvc structure.
<?php
class Default_Model
{
private $defaultPage = array
(
'headline' => 'JOBBSÖKAREN',
'instruction' => 'logga in nedanför'
);
public function __construct()
{
}
public function getContent()
{
line 17 return $defaultPage;
}
}
?>
here is the error message: Notice: Undefined variable: defaultPage in /home/mengus/dev/www/models/default.php on line 17
so what I dont get is why the array is undefined. I use similar code in other classes and it works just fine. is it a scope issue? I seem to have gone error blind from staring at this :) thanks for help.