当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Controller_Action::render方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:brunopbaffonso,项目名称:ongonline,代码行数:59,代码来源:Report.php

示例2: run

 public static function run(Zend_Controller_Action $ctrl, $url)
 {
     self::setUrl($url);
     $ctrl->render('');
 }
开发者ID:Cryde,项目名称:sydney-core,代码行数:5,代码来源:Content.php


注:本文中的Zend_Controller_Action::render方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。