I implemented this (CodeIgniter and HMVC questions) and now my code is breaking. I am getting errors such as
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Auth::$load
Please help!!
im using ci 2.1.4 with hmvc by wiredesign
code:
class MY_Controller extends MX_Controller {
public function __construct() {
// do some stuff here that affects all controllers
}
}
// --------------------------------------------------------------------------
/**
* Frontend Controller Deals with public pages that dont require auth like website pages etc
*/
class Frontend_Controller extends MY_Controller {
public function __construct() {
parent::__construct();
}
}
// --------------------------------------------------------------------------
/**
* Backend Controller provides a DRY implementation of auth, ACL etc required by access only pages
*/
class Backend_Controller extends MY_Controller {
public function __construct() {
parent::__construct();
// Check admin login, etc.
}
// --------------------------------------------------------------------------
}
/* end file application/core/MY_Controller.php */
Then in another file login.php located in application/controllers
class Login extends Backend_Controller {
// --------------------------------------------------------------------------
function index() { //check if loggedin already
$data['required_page'] = 'login';
$this->load->module('auth');
$this->auth->load->view('login', $data);
}