-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
新建的Service没有生效 #134
Comments
protected function xxx() |
在Action中直接使用$this->xxxService->check_basic(); 也是可以的,但用上面的格式引用就没有效果了,将check_basic()函数复制到privilegeService也是可以生效的。就是另建一个xxxService不行,不知道是那是理解错了 |
文件是放在service目录下吗 |
这样定义 然后获取 |
privilegeService 比较特殊 是框架的鉴权service 正常使用service 就是 |
哦,原来privilegeService是特殊定义的,我原来以为每定义一个userauthService.php都可以这样在Action中定义这种鉴权格式。因为我想另外定义一种鉴权方法。那只好将方法定义在privilegeService了。 |
还有valid_privilege()的 $this->privilege() 这个定义是不是错了 |
$this->privilege() 是当前xxxAction 定义的鉴权声明
|
哦,好的,谢谢 |
我在service中建一个新的xxxService.php.结构与privilegeService一样。但Action中没有效果。是什么会事?
The text was updated successfully, but these errors were encountered: