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


PHP Zend_Controller_Action_Helper_ViewRenderer::postDispatch方法代码示例

本文整理汇总了PHP中Zend_Controller_Action_Helper_ViewRenderer::postDispatch方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Controller_Action_Helper_ViewRenderer::postDispatch方法的具体用法?PHP Zend_Controller_Action_Helper_ViewRenderer::postDispatch怎么用?PHP Zend_Controller_Action_Helper_ViewRenderer::postDispatch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Controller_Action_Helper_ViewRenderer的用法示例。


在下文中一共展示了Zend_Controller_Action_Helper_ViewRenderer::postDispatch方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: postDispatch

 /**
  * postDispatch - auto render a view
  *
  * Override Zend_Controller_Action_Helper_ViewRenderer::postDispatch()
  * @return void
  */
 public function postDispatch()
 {
     /**
      * Get module name, controller name, action name
      */
     $request = $this->getRequest();
     $module = $request->getModuleName();
     if (null === $module) {
         $module = $this->getFrontController()->getDispatcher()->getDefaultModule();
     }
     $controller = $request->getControllerName();
     if (null === $controller) {
         $controller = $this->getFrontController()->getDispatcher()->getDefaultControllerName();
     }
     $action = $request->getActionName();
     if (null == $action) {
         $action = $this->getFrontController()->getDispatcher()->getDefaultAction();
     }
     /**
      * Set cacheId for Smarty's caching
      */
     $langCode = Vi_Registry::get('langCode');
     $this->view->cacheId = Vi_Registry::getAppName() . '|' . $langCode . '|module|' . $module . '_' . $controller . '_' . $action . ($this->view->cacheId ? '_' . $this->view->cacheId : '');
     /**
      * Call parent's postDispatch() function
      */
     $result = parent::postDispatch();
     /**
      * Revive Vi_Language::$currentType and Vi_Language::$currentName
      */
     Vi_Language::$currentType = Vi_Registry::get('controllerCurrentType');
     Vi_Language::$currentName = Vi_Registry::get('controllerCurrentName');
     return $result;
 }
开发者ID:judasnow,项目名称:qspread20101020,代码行数:40,代码来源:ViewRenderer.php

示例2: postDispatch

 function postDispatch()
 {
     if ($_SERVER['HTTP_X_REQUESTED_WITH'] || $this->getRequest()->ajax) {
         $this->getResponse()->appendBody(Zend_Json::encode(var_export($this->view), true));
     } else {
         parent::postDispatch();
     }
 }
开发者ID:BGCX261,项目名称:zportal-svn-to-git,代码行数:8,代码来源:AjaxableViewRenderer.php

示例3: testPostDispatchDoesNotRenderViewWhenNoViewRendererSet

 public function testPostDispatchDoesNotRenderViewWhenNoViewRendererSet()
 {
     $this->request->setModuleName('bar')->setControllerName('index')->setActionName('index');
     $this->front->setParam('noViewRenderer', true);
     $controller = new Bar_IndexController($this->request, $this->response, array());
     $this->helper->postDispatch();
     $body = $this->response->getBody();
     $this->assertTrue(empty($body));
 }
开发者ID:SustainableCoastlines,项目名称:loveyourwater,代码行数:9,代码来源:ViewRendererTest.php

示例4: postDispatch

 public function postDispatch()
 {
     if (!$this->_noRender && null !== $this->_actionController && $this->getRequest()->isDispatched() && !$this->getResponse()->isRedirect()) {
         if ($this->isJson()) {
             $this->getResponse()->setHeader('Content-Type', 'application/json');
         } else {
             $this->getResponse()->setHeader('Content-Type', 'text/html; charset=utf-8');
         }
     }
     parent::postDispatch();
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:11,代码来源:ViewRenderer.php

示例5: postDispatch

 public function postDispatch()
 {
     if ($this->_shouldRender()) {
         if (method_exists($this->getActionController(), "getRenderScript")) {
             if ($script = $this->getActionController()->getRenderScript()) {
                 $this->renderScript($script);
             }
         }
     }
     parent::postDispatch();
 }
开发者ID:ngocanh,项目名称:pimcore,代码行数:11,代码来源:ViewRenderer.php

示例6: postDispatch

 /**
  *
  */
 public function postDispatch()
 {
     if ($this->_shouldRender()) {
         if (method_exists($this->getActionController(), "getRenderScript")) {
             if ($script = $this->getActionController()->getRenderScript()) {
                 $this->renderScript($script);
             }
         }
     }
     parent::postDispatch();
     // append custom styles to response body
     if ($this->getActionController() instanceof FrontendController) {
         $doc = $this->getActionController()->getDocument();
         if (Tool::isHtmlResponse($this->getResponse()) && $doc && method_exists($doc, "getCss") && $doc->getCss() && !$this->getRequest()->getParam("pimcore_editmode")) {
             $code = '<style type="text/css" id="pimcore_styles_' . $doc->getId() . '">';
             $code .= "\n\n" . $doc->getCss() . "\n\n";
             $code .= '</style>';
             $name = $this->getResponseSegment();
             $this->getResponse()->appendBody($code, $name);
         }
     }
 }
开发者ID:Gerhard13,项目名称:pimcore,代码行数:25,代码来源:ViewRenderer.php


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