/** * getContent() * * @param \Zend\Tool\Project\Context $context * @param string $method * @param mixed $parameters */ public function getContent(Context $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 $context * @param string $method * @param mixed $parameters * @return string */ public function getContent(Context $context, $method, $parameters) { $streamUri = $this->_storage->getStreamUri($this->_contentPrefix . '/' . $context->getName() . '/' . $method . '.php'); if (method_exists($context, 'getCodeGenerator')) { $codeGenerator = $context->getCodeGenerator(); } else { $codeGenerator = new FileGenerator(); } $codeGenerator = (include $streamUri); if (!$codeGenerator instanceof AbstractGenerator) { throw new Exception\RuntimeException('Custom file at ' . $streamUri . ' did not return the $codeGenerator object.'); } return $codeGenerator->generate(); }