Thinkphp3.2版本,获取指定控制器下所有方法。
Wash
Wash 2017-03-28 09:31:04
0
2
1181
get_class_methods(IndexController)//已经测试过无效
get_class_methods(new IndexController)//可以获取当前控制器下所有方法和父级的所有方法

使用类反射

$r=new \ReflectionClass(new IndexController());
p($r->getmethods());//返回所有的方法包括父级

网上目前资料还未能解决我的困惑

Wash
Wash

reply all(2)
数据分析师

Thinkphp3.2 version, get all methods under the specified controller. -PHP Chinese website Q&A-Thinkphp3.2 version, get all methods under the specified controller. -PHP Chinese website Q&A

Let’s take a look and learn.

左手右手慢动作

我这试过都没有问题的,你的类有没有定义什么属性

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template