tp5使用trait报错

浏览:2452 发布日期:2017/08/29 分类:求助交流 关键字: trait
我使用行为进行权限验证,当没有权限时使用 jump trait的error方法进行提示,但是我在行为中use Jump时报错:
[64] ErrorException in Jump.php line 25
Cannot declare trait traits\controller\Jump, because the name is already in use
查看代码发现,controller中14行
\think\Loader::import('controller/Jump', TRAIT_PATH, EXT);
导入了trait,该导入方法import使用include实现文件加载,但是我在behavior中已经引入了trait文件,导致两次加载文件,所以爆出declare错误。
请问官方,这种问题我应该如何修改为好。
最佳答案
评论( 相关
后面还有条评论,点击查看>>