【发布时间】:2015-01-30 21:59:42
【问题描述】:
我正在尝试在 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; }
我该如何解决这个问题?
【问题讨论】:
标签: php zend-framework