有没有办法在CakePHP的Auth中包含要检查的字段?
例如: if status_id == 1
发布于 2014-04-05 19:12:59
您需要在auth组件设置中添加status_id =1。喜欢
public $components = array(
'Session',
'Auth' => array(
'loginRedirect' => array('controller' => 'posts', 'action' => 'index'),
'logoutRedirect' => array('controller' => 'pages', 'action' => 'display', 'home'),
'authorize' => array('Controller'),
'authenticate' => array(
'Form' => array(
'scope' => array(
'status_id' => 1
)
)
)
)
);https://stackoverflow.com/questions/22885041
复制相似问题