嗨,我在这行代码中需要帮助,我已经在我找到的文档中搜索$this->request->params['pass'][0]但是我无法理解它的用途是什么
什么$this->request->params['pass'][0]意思?
有人可以帮助我吗?
我需要CakePHP中的帮助 - 简单身份验证和授权应用程序教程
public function isAuthorized($user) {
// All registered users can add posts
if ($this->action === 'add') {
return true;
}
// The owner of a post can edit and delete it
if (in_array($this->action, array('edit', 'delete'))) {
$postId = $this->request->params['pass'][0];
if ($this->Post->isOwnedBy($postId, $user['id'])) {
return true;
}
}
return parent::isAuthorized($user);
}
Run Code Online (Sandbox Code Playgroud)
这部分我不知道这意味着什么,我已经搜索谷歌但我没有找到
$this->Post->isOwnedBy($postId, $user['id'])
Run Code Online (Sandbox Code Playgroud)