Example #1
0
 /**
  * getContent()
  *
  * @param Zend_Tool_Project_Context_Interface $context
  * @param string $method
  * @param mixed $parameters
  */
 public function getContent(Zend_Tool_Project_Context_Interface $context, $method, $parameters)
 {
     $streamUri = $this->_storage->getStreamUri($this->_contentPrefix . '/' . $context->getName() . '/' . $method . '.phtml');
     ob_start();
     include $streamUri;
     $content = ob_get_clean();
     return $content;
 }
 /**
  * getContent()
  *
  * @param Zend_Tool_Project_Context_Interface $context
  * @param string $method
  * @param mixed $parameters
  * @return string
  */
 public function getContent(Zend_Tool_Project_Context_Interface $context, $method, $parameters)
 {
     $streamUri = $this->_storage->getStreamUri($this->_contentPrefix . '/' . $context->getName() . '/' . $method . '.php');
     if (method_exists($context, 'getCodeGenerator')) {
         $codeGenerator = $context->getCodeGenerator();
     } else {
         $codeGenerator = new Zend_CodeGenerator_Php_File();
     }
     $codeGenerator = (include $streamUri);
     if (!$codeGenerator instanceof Zend_CodeGenerator_Abstract) {
         throw new Zend_Tool_Project_Exception('Custom file at ' . $streamUri . ' did not return the $codeGenerator object.');
     }
     return $codeGenerator->generate();
 }