Skip to content
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

继承类的权限判断后中止执行并提示的需求 #16

Open
qidizi opened this issue Jun 28, 2014 · 2 comments
Open

继承类的权限判断后中止执行并提示的需求 #16

qidizi opened this issue Jun 28, 2014 · 2 comments

Comments

@qidizi
Copy link

qidizi commented Jun 28, 2014

有一种需求是
需要登录类继承ci_conctrolls,且登录状态在这个类中判断并做通过处理,只有通过了,才能继续执行子类的方法,否则应该输出提示,终止执行

其它子类就继承登录类,

这时,如果在登录类中直接使用exit中止就会导致view之类后续处理不会运行.
我看了一下ci的主体,没找到可以直接的方法,

目前我是在__construct中检查,异常,设定类内值,在remap中改变$CI的下步运行的类.
可能hook也可以做,但是比较绕不是用来终止子类运行的好方法.

@qidizi
Copy link
Author

qidizi commented Jun 28, 2014

里面用到改变$CI全局变量的取巧方式.如果升级改变了system的实现就会出现问题.不是一个ci支持的方式.

@hex-ci
Copy link
Member

hex-ci commented Jun 30, 2014

这是个需求,目测可以通过扩展的形式实现。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants