Auth-> allowedActions()和Auth-> allow()之间的区别是什么? ?
$this->Auth->allowedActions = array('index','view','archive','listarchive','viewfromcategory','tags','aboutme','contact','polls');
或者
$this->Auth->allow(array('index','view','archive','listarchive','viewfromcategory','tags','aboutme','contact','polls'));
答案 0 :(得分:3)
使用allow()向allowedActions添加更多操作(除了那些已经存在的操作)。 allow()的语法是$this->Auth->allow('index','view');