2
当我点击我的导航栏上的招生项下的Enroll Now
按钮时,应该显示\merry_flowers\views\students\add.ctp
。
相反,登录页面正在显示。 有人知道我做错了什么吗?
下面是我app_controller.php
项目为:
class AppController extends Controller {
var $components=array('Auth','Session','Cookie');
function beforeFilter(){
if (isset($this->Auth)){
$this->Auth->userModel='MerryParent';
$this->Auth->loginAction=array('controller'=>'merry_parents','action'=>'login');
//var_dump($this->data);
$this->Auth->allow('*');
$this->Auth->loginRedirect=array('controller'=>'merry_parents','action'=>'report_card');
$this->Auth->logoutRedirect=array('controller'=>'merry_parents','action'=>'register');
$this->Auth->deny('report_card');
$this->Auth->authorize='controller';
}
else
$this->Session->setFlash('Auth has not been set');
}
function isAuthorized(){
return true;
}
任何帮助深表感谢。
嗨,如你所建议的,我将Parent :: beforeFilter()添加到了StudentsController中的beforeFilter中,现在一切正常。非常感谢!:) – vaanipala