diff -r 5b37998e522e -r 162c1de6545a web/lib/Zend/Tool/Project/Context/Zf/FormFile.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/lib/Zend/Tool/Project/Context/Zf/FormFile.php Fri Mar 11 15:05:35 2011 +0100 @@ -0,0 +1,113 @@ +_formName = $this->_resource->getAttribute('formName'); + $this->_filesystemName = ucfirst($this->_formName) . '.php'; + parent::init(); + } + + /** + * getPersistentAttributes + * + * @return array + */ + public function getPersistentAttributes() + { + return array( + 'formName' => $this->getFormName() + ); + } + + /** + * getName() + * + * @return string + */ + public function getName() + { + return 'FormFile'; + } + + public function getFormName() + { + return $this->_formName; + } + + public function getContents() + { + + $className = $this->getFullClassName($this->_formName, 'Form'); + + $codeGenFile = new Zend_CodeGenerator_Php_File(array( + 'fileName' => $this->getPath(), + 'classes' => array( + new Zend_CodeGenerator_Php_Class(array( + 'name' => $className, + 'extendedClass' => 'Zend_Form', + 'methods' => array( + new Zend_CodeGenerator_Php_Method(array( + 'name' => 'init', + 'body' => '/* Form Elements & Other Definitions Here ... */', + )) + ) + + )) + ) + )); + return $codeGenFile->generate(); + } +}