本文整理汇总了PHP中Zend_Controller_Action::render方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Controller_Action::render方法的具体用法?PHP Zend_Controller_Action::render怎么用?PHP Zend_Controller_Action::render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Controller_Action
的用法示例。
在下文中一共展示了Zend_Controller_Action::render方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handleRequest
/**
* Manipula uma chamada para relatório, mostrando o formulário correto,
* executando a classe e operação de domínio que levanta os dados e renderizando
* a view/partial correta
* <br/>
* $renderViews são um array onde o índice é o nome de um parâmetro que pode ser
* recebido no request e o valor é a view a ser renderizada.<br/>
* O índice 'report' deve ser usado com a view de relatório padrão. 'form'
* deve ser utilizado para a view de interface para renderizar o formulário.
* <br/>
* ['report'] => 'view-padrao'<br/>
* ['form'] => 'view-form'<br/>
* ['summarized'] => 'view-summarized'<br/>
*
* @param String $domainClass
* @param String $domainAction
* @param String $formClass name of the form class
* @param ArrayObject $renderViews
* @param String $viewFolder é o nome do diretório onde estão as views, para ser renderizada com retorno, em geral para o pdf
* @param Zend_View $view o objeto view
* @param Zend_Request $request o objeto request
* @return String
*/
public function handleRequest($domainClass, $domainAction, $formClass, array $renderViews, $viewFolder, Agana_Print_Meta $metaReport, Zend_Controller_Action $controller)
{
// die(Zend_Debug::dump($controller->view));
$controller->view->records = null;
if ($controller->getRequest()->getParam('format')) {
$layout = Zend_Layout::getMvcInstance();
$layout->setLayout('report.layout');
$domain = new $domainClass();
$controller->view->records = $domain->{$domainAction}(Zend_Auth::getInstance()->getIdentity()->appaccount_id, $controller->getRequest()->getParams());
$viewToRender = $this->viewToRender($controller->getRequest()->getParams(), $renderViews);
$controller->view->format = $controller->getParam('format');
$personDomain = new Persons_Domain_Person();
$person = $personDomain->getById(Zend_Auth::getInstance()->getIdentity()->person_id);
$appAccount = $person->getAppaccount();
$metaReport->setAccountName($appAccount->getName());
if ($controller->getParam('format') == 'pdf') {
$report = new Agana_Print_Pdf_Report($metaReport, $controller->view->theme_path);
$controller->view->assign('report', $report);
$layout->disableLayout();
$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
$viewRenderer->setNoRender(true);
$content = $controller->view->render($viewFolder . '/' . $viewToRender . '.phtml');
$report->addPage($content);
$report->download();
} else {
$report = new Agana_Print_Html_Report($metaReport, '');
$controller->view->assign('report', $report);
return $controller->render($viewToRender);
}
} else {
$form = new $formClass();
$controller->view->assign('form', $form);
$viewToRender = $renderViews['form'];
return $controller->render($viewToRender);
}
}
示例2: run
public static function run(Zend_Controller_Action $ctrl, $url)
{
self::setUrl($url);
$ctrl->render('');
}