【发布时间】:2013-03-27 14:44:02
【问题描述】:
我在网上看到一些代码,为了检查访问具体操作的权限,他们以这种方式使用Configure::read函数:
public function action1(){
if(!Configure::read('isAdmin')){
$this->redirect(array('controller' => 'depots', 'action' => 'status'));
}
//whatever
}
我想知道,为此目的使用Configure::read 和Configure:write 与使用$this->Session->read() 和$this->Session->write() 之间有什么区别?
哪种检查方法更好?
谢谢。
【问题讨论】:
标签: php cakephp cakephp-2.0 cakephp-2.2 cakephp-2.3