I have this controller:
class Start extends CI_Controller{ var $base; var $css; function Start() { parent::Controller(); //error here. $this->base = $this->config->item('base_url'); //error here $this->css = $this->config->item('css'); } function hello($name) { $data['css'] = $this->css; $data['base'] = $this->base; $data['mytitle'] = 'Welcome to this site'; $data['mytext'] = "Hello, $name, now we're getting dynamic!"; $this->load->view('testView', $data); } }
he tells me on this line:
Parent :: Controller (); // error here.
Call to undefined method CI_Controller::Controller()
If I delete this line .. I get an error for the next line that says ..
Call to a member function item() on a non-object
How to prevent the occurrence of such errors?
source share