I’m brand new to CodeIgniter, and I’m trying to execute some simple examples in order to understand how they work. The problem is I’m trying to play with a simple controller to just display a simple view that just says “Index!” in a strong font. I’m also using a .htaccess in order to avoid ‘index.php’ in front of the name of the controller. I’m using mod_rewrite to achieve this. I’m using:
Options +FollowSymLinks
RewriteEngine on
RewriteCond $1 !^(index\.php|files|assets|robots\.txt)
RewriteRule ^(.*)$ ./index.php/$1 [L]
in routes.php I have:
$route['default_controller'] = "main";
which tells CodeIgniter that I want to use a controller called main.php
which possesses a
Here’s my complete controller:
class Main extends CI_Controller {
public function index() {
$this->load->view('main');
}
public function ingrid() {
$this->load->view('ingrid');
}
public function remote() {
$this->load->view('remote');
}
}
inside it, and should have executed a ‘main.php’ controller inside views.
Everything appears to be fine but it keeps giving me this error:
Severity: Notice
Message: Undefined property: Main::$load
Filename: controllers/main.php
Line Number: 50
Backtrace:
File: /Users/sam/webroot/voipXX_client_care/application/controllers/main.php
Line: 50
Function: _exception_handler
File: /Users/sam/webroot/voipXX_client_care/index.php
Line: 260
Function: require_once
The problem is, I don’t understand.
Your controller is probably extending a base Controller right?
Then try to call parent::Controller(); in the constructor of your Main() class.