本文整理汇总了PHP中Zend_Controller_Action::postDispatch方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Controller_Action::postDispatch方法的具体用法?PHP Zend_Controller_Action::postDispatch怎么用?PHP Zend_Controller_Action::postDispatch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Controller_Action
的用法示例。
在下文中一共展示了Zend_Controller_Action::postDispatch方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preDispatch
public function preDispatch()
{
parent::postDispatch();
$auth = Zend_Auth::getInstance();
if (!$auth->hasIdentity()) {
echo "não tem acesso";
$this->redirect('/auth');
}
}
示例2: postDispatch
/**
* @inheritdoc
*/
public function postDispatch()
{
parent::postDispatch();
// Render view if it was not rendered before
if (!$this->view->isRendered()) {
$actionName = $this->getRequest()->getActionName();
$this->render($actionName);
}
}
示例3: postDispatch
/**
* post dispatch method
*
* @author Eddie Jaoude
* @param void
* @return void
*
*/
public function postDispatch()
{
parent::postDispatch();
if (empty($this->view->alert)) {
$this->view->alert = $this->_flashMessenger->getMessages();
} else {
if (!is_array($this->view->alert)) {
throw new Exception('Alert string $this->view->alert must be an array');
}
}
}
开发者ID:rohankoid,项目名称:Zend-Framework--Doctrine-ORM--PHPUnit--Ant--Jenkins-CI--TDD-,代码行数:19,代码来源:BaseController.php
示例4: postDispatch
/**
* Reescreve o método postDispatch() que é responsável
* por executar uma ação após a execução de um método
* @access public
* @param void
* @return void
*/
public function postDispatch()
{
if ($this->_msg->hasMessages()) {
$this->view->message = implode("<br />", $this->_msg->getMessages());
}
if ($this->_type->hasMessages()) {
$this->view->message_type = implode("<br />", $this->_type->getMessages());
}
parent::postDispatch();
// chama o método pai
}
示例5: preDispatch
public function preDispatch()
{
parent::postDispatch();
$auth = Zend_Auth::getInstance();
if (!$auth->hasIdentity()) {
session_start();
$_SESSION['acess'] = '0';
} else {
$_SESSION['acess'] = '1';
}
}
示例6: postDispatch
/**
* Post-dispatch routines
* Asignar variables de entorno
*
* @return void
*/
public function postDispatch()
{
parent::postDispatch();
$this->view->messages = $this->_helper->flashMessenger->getMessages();
$this->view->yosonVars = $this->_yosonVars;
// if (APPLICATION_ENV != 'production') {
// $sep = sprintf('[%s]', strtoupper(substr(APPLICATION_ENV, 0, 3)));
// $titleStack = $this->view->headTitle()->getContainer()->getValue();
// if (!is_array($titleStack) || (is_array($titleStack) && isset($titleStack[0]) && $titleStack[0] != $sep) ){
// $this->view->headTitle()->prepend($sep);
// }
// }
}
示例7: postDispatch
/**
* Erstellt die komplette Ausgabe der Actions als JSON
*/
public function postDispatch()
{
switch ($this->responseType) {
// use zend view
case self::RESPONSE_TYPE_HTML_VIEW:
$this->setContentTypeValue('text/html');
break;
// return as javascript variable
// return as javascript variable
case self::RESPONSE_TYPE_JS_VAR:
$responseString = sprintf("var %s = %s;", isset($this->responseTypeParams['name']) ? $this->responseTypeParams['name'] : 'CMSDATA', \Zend_Json::encode($this->responseData));
$this->buildResponse($responseString, 'application/javascript; charset=utf-8');
break;
// return as json
// return as json
case self::RESPONSE_TYPE_JSON:
default:
$json = \Zend_Json::encode($this->responseData);
$this->buildResponse($json, $this->contentTypeValue);
break;
}
parent::postDispatch();
}
示例8: postDispatch
public function postDispatch()
{
if (!$this->getLayout()->isLoaded() and $this->getRequest()->isDispatched()) {
$this->_forward('noroute');
}
parent::postDispatch();
}
示例9: postDispatch
/**
* Post-dispatch routines.
*
* Common usages for postDispatch() include rendering content in a site wide
* template, link url correction, setting headers, etc.
*/
public function postDispatch()
{
parent::postDispatch();
$this->view->addHelperPath(BASE_PATH . '/core/views/helpers', 'Zend_View_Helper_');
}
示例10: postDispatch
/**
* Setzt alle Daten des Layouts der Session
*/
public function postDispatch()
{
parent::postDispatch();
$this->view->messages = $this->_helper->FlashMessenger->getMessages();
}
示例11: postDispatch
/**
* Post-dispatch routines
* Asignar variables de entorno
*
* @return void
*/
public function postDispatch()
{
parent::postDispatch();
//$this->view->messages = $this->_helper->flashMessenger->getMessages();
$this->view->yosonVars = $this->_yosonVars;
}
示例12: postDispatch
public function postDispatch()
{
parent::postDispatch();
Centurion_Signal::factory('post_dispatch')->send($this);
}
示例13: postDispatch
/**
* postDispatch
*
* executes once a controller action has completed, prior to the view
* renderer displaying the view.
*/
public function postDispatch()
{
$this->setMessages();
parent::postDispatch();
$this->_flashMessenger->addMessage("");
}
示例14: postDispatch
/**
* postDispatch
* @author Thomas Schedler <tsh@massiveart.com>
* @version 1.0
*/
public function postDispatch()
{
if ($this->blnPostDispatch == true) {
// trigger client specific dispatch helper
if ($this->core->sysConfig->helpers->client->dispatcher === 'enabled') {
ClientHelper::get('Dispatcher')->postDispatch($this);
}
if (function_exists('tidy_parse_string') && $this->blnCachingOutput == false && $this->getResponse()->getBody() != '') {
/**
* Tidy is a binding for the Tidy HTML clean and repair utility which allows
* you to not only clean and otherwise manipulate HTML documents,
* but also traverse the document tree.
*/
$arrConfig = array('indent' => TRUE, 'output-xhtml' => TRUE, 'wrap' => 200);
$objTidy = tidy_parse_string($this->getResponse()->getBody(), $arrConfig, $this->core->sysConfig->encoding->db);
$objTidy->cleanRepair();
$this->getResponse()->setBody($objTidy);
}
if (isset($this->objCache) && $this->objCache instanceof Zend_Cache_Frontend_Output) {
if ($this->blnCachingStart === true) {
$response = $this->getResponse()->getBody();
$this->getResponse()->setBody(str_replace("<head>", "<head>\r\n <!-- This is a ZOOLU cached page (" . date('d.m.Y H:i:s') . ") -->", $response));
$this->getResponse()->outputBody();
$arrTags = array();
if ($this->objPage->getIsStartElement(false) == true) {
$arrTags[] = 'Start' . ucfirst($this->objPage->getType());
}
$arrTags[] = ucfirst($this->objPage->getType()) . 'Type_' . $this->objPage->getTypeId();
$arrTags[] = ucfirst($this->objPage->getType()) . 'Id_' . $this->objPage->getPageId() . '_' . $this->objPage->getLanguageId();
$this->core->logger->debug(var_export($arrTags, true));
$this->objCache->end($arrTags);
$this->core->logger->debug('... end caching!');
exit;
}
}
parent::postDispatch();
}
}
示例15: addAction
public function addAction()
{
parent::postDispatch();
$auth = Zend_Auth::getInstance();
if (!$auth->hasIdentity()) {
$this->redirect('/auth');
}
$adapter = new Zend_File_Transfer_Adapter_Http();
$dbTable = new Application_Model_DbTable_Block();
$lastText = $dbTable->getTextById($_GET['id']);
$this->view->block = $lastText;
}