laruence / yaf

Fast php framework written in c, built in php extension
http://pecl.php.net/package/yaf
Other
4.52k stars 1.37k forks source link

插件中怎么使用ReflectionMethod #560

Closed crytjy closed 2 years ago

crytjy commented 3 years ago

在控制器中添加了一些注释,想通过ReflectionMethod获取方法的注释,但因为我用了多模块的,一直提示找不到控制器。请问要怎么解决?

$ref = new \ReflectionMethod($className, $functionName);
$doc = $ref->getDocComment();

提示 "*message":"Class IndexController does not exist"

Yaf\Loader::autoload(): Failed opening script /www/wwwroot/yaf/app/controllers/Index.php: No such file or directory
keilestone commented 2 years ago

手动\Yaf\Loader::import模块的控制器