[eluser]Unknown[/eluser]
I'm new to MVC, OOP & CodeIgniter and still loving it. I created a basic website using CodeIgniter and all seemed fine until I decided to try to get clever.
I have a page called start.php which contains
Code:
class Start extends Controller {
various properties and methods in here
}
This all works fine.
Then I decided that I want pages grouped together and so decided to copy the page start.php, rename it to services.php and rename the class to
Code:
class Services extends Controller {
various properties and methods in here
}
Now when I try to browse to a page which should serve up the content from the new class, I get the following error message:
Quote:Message: Undefined property: Services::$menu
The message claims that the source of the error is at line 57, which contains this
Code:
$data['menu'] = $this->menu->show_menu();
At the top of the class, I have
Code:
function Start()
{
parent::Controller();
$this->load->helper('url');
$this->load->library('menu');
$this->load->library('menulower');
$this->load->library('banner');
$this->base = $this->config->item('base_url');
$this->css = $this->config->item('css');
$this->robots = '<meta name="robots" content="index, follow" />';
}
This all works fine for the class Start extends Controller, so I don't understand why it will not work for my new class. Can someone please help.
Thanks