本文整理汇总了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;
}
示例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();
}
}
示例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));
}
示例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();
}
示例5: postDispatch
public function postDispatch()
{
if ($this->_shouldRender()) {
if (method_exists($this->getActionController(), "getRenderScript")) {
if ($script = $this->getActionController()->getRenderScript()) {
$this->renderScript($script);
}
}
}
parent::postDispatch();
}
示例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);
}
}
}