I am loading view in codeigniter and calling $this->load->view('login'); in my controller. But it gives me following error
Severity: Notice
Message: Undefined property: Login::$load
Filename: controllers/login.php
Line Number: 6
Fatal error: Call to a member function view() on a non-object in /Applications/XAMPP/xamppfiles/htdocs/membership_system/application/controllers/login.php on line 6
Here is my controller
class Login extends CI_Controller {
public function index() {
$this->load->view('login'); //<-- error is on this line
}
public function login() {
}
public function register() {
}
}
how can I solve this problem?
UPDATE
When I change class name from Login to Something_login then this works but only with Login it gives me above error. Why?
the name of function must be different from your Class name.