CakePHP:Auth-> allowedActions()和Auth-> allow()之间有什么区别?

时间:2011-10-25 17:00:12

标签: php cakephp cakephp-2.0

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'));

1 个答案:

答案 0 :(得分:3)

使用allow()向allowedActions添加更多操作(除了那些已经存在的操作)。 allow()的语法是$this->Auth->allow('index','view');