public function controllerFile() { $className = $this->_parameters->className; $codeGenFile = new Zend_Tool_CodeGenerator_Php_File(array('classes' => array(new Zend_Tool_CodeGenerator_Php_Class(array('className' => $className, 'extendedClassName' => 'Zend_Controller_Action', 'methods' => array(new Zend_Tool_CodeGenerator_Php_Method(array('name' => 'init', 'body' => ' /* Initialize action controller here */')), new Zend_Tool_CodeGenerator_Php_Method(array('name' => 'indexAction', 'body' => ' /* Default action for action controller */')))))))); if ($className == 'ErrorController') { $classes = $codeGenFile->getClasses(); $classes[0]->addMethod(new Zend_Tool_CodeGenerator_Php_Method(array('name' => 'errorAction', 'body' => ' // some errorAction stuff here'))); } return $codeGenFile->toString(); }