我正在尝试在cmd中的zendframework 1.12.x上为一个控制器创建一个操作。当我尝试创建操作时,出现此错误:
致命错误:在布尔值上调用成员函数 setMethod() C:''程序 Files''ZendFramework-latest''library''Zend''Tool''Project''Context''Zf''ActionMethod.php 在第 198 行。
这是提到的函数的代码:
public static function createActionMethod($controllerPath, $actionName, $body = ' // action body') {
if (!file_exists($controllerPath)) {
return false;
}
$controllerCodeGenFile = >Zend_CodeGenerator_Php_File::fromReflectedFileName($controllerPath, true, >true);
$controllerCodeGenFile->getClass()->setMethod(array(
'name' => $actionName . 'Action',
'body' => $body
));
file_put_contents($controllerPath, $controllerCodeGenFile->generate());
return true; }
我该如何解决这个问题?
在代码的 6 行上有一个">"字符,而在源代码中它是
$controllerCodeGenFile = Zend_CodeGenerator_Php_File::fromReflectedFileName($controllerPath, true, true);
但这应该会导致解析错误。