我实现了这个(CodeIgniter and HMVC questions) 现在我的代码破了。 我收到了诸如
之类的错误遇到PHP错误
严重性:注意
消息:未定义的属性:Auth :: $ load
请帮助!!
即时通过wiredesign使用ci 2.1.4和hmvc
代码:
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);
}