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


PHP Controller::afterFilter方法代码示例

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


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

示例1: beforeRender

 public function beforeRender()
 {
     parent::afterFilter();
     unset($this->viewVars['_serialize']);
     foreach ($this->viewVars as $key => $var) {
         $this->viewVars['_serialize'][] = $key;
     }
 }
开发者ID:robksawyer,项目名称:cake-jwt-seed,代码行数:8,代码来源:AppController.php

示例2: afterFilter

 public function afterFilter()
 {
     parent::afterFilter();
     if (substr($this->params['action'], 0, 4) == 'app_' && !empty($this->data)) {
         $this->layout = 'app';
         $this->render('/Pages/app');
     }
 }
开发者ID:kiah2008,项目名称:talent-radar,代码行数:8,代码来源:AppController.php

示例3: afterFilter

 function afterFilter()
 {
     //log degli errori smtp
     if (!empty($this->Email->smtpError)) {
         $this->log($this->Email->smtpError, 'smtp-errors');
     }
     return parent::afterFilter();
 }
开发者ID:amerlini,项目名称:digigas-from-hg,代码行数:8,代码来源:app_controller.php

示例4: _outputMessage

 /**
  * Generate the response using the controller object.
  *
  * @param string $template The template to render.
  * @return void
  */
 protected function _outputMessage($template)
 {
     try {
         $this->controller->render($template);
         $this->controller->afterFilter();
         $this->controller->response->send();
     } catch (Exception $e) {
         $this->_outputMessageSafe('error500');
     }
 }
开发者ID:nabeelio,项目名称:CakePHP-Base,代码行数:16,代码来源:ExceptionRenderer.php

示例5: afterFilter

 function afterFilter()
 {
     parent::afterFilter();
     /**
      * 出力文字コードの変換
      */
     if (!empty($this->params['prefix']) && $this->params['prefix'] === 'm') {
         $this->output = mb_convert_kana($this->output, "rak", "UTF-8");
         //$this->output = mb_convert_encoding($this->output, "SJIS", "UTF-8");
         $this->output = mb_convert_encoding($this->output, "SJIS-win", "UTF-8");
     }
 }
开发者ID:masayukiando,项目名称:cakephp1.3-mailmagazine,代码行数:12,代码来源:app_controller.php

示例6: _outputMessage

/**
 * Generate the response using the controller object.
 *
 * @param string $template The template to render.
 * @return void
 */
	protected function _outputMessage($template) {
		try {
			$this->controller->render($template);
			$this->controller->afterFilter();
			$this->controller->response->send();
		} catch (MissingViewException $e) {
			$attributes = $e->getAttributes();
			if (isset($attributes['file']) && strpos($attributes['file'], 'error500') !== false) {
				$this->_outputMessageSafe('error500');
			} else {
				$this->_outputMessage('error500');
			}
		} catch (Exception $e) {
			$this->_outputMessageSafe('error500');
		}
	}
开发者ID:hungnt88,项目名称:5stars-1,代码行数:22,代码来源:ExceptionRenderer.php

示例7: _outputMessage

 /**
  * Generate the response using the controller object.
  *
  * @param string $template The template to render.
  * @return void
  */
 protected function _outputMessage($template)
 {
     $this->controller->render($template);
     $this->controller->afterFilter();
     $this->controller->response->send();
 }
开发者ID:Chromedian,项目名称:inventory,代码行数:12,代码来源:ExceptionRenderer.php

示例8: afterFilter

 public function afterFilter()
 {
     parent::afterFilter();
     // Output compression on all requests
     $parser = \WyriHaximus\HtmlCompress\Factory::construct();
     $compressedHtml = $parser->compress($this->response->body());
     //$this->response->compress();
     $this->response->body($compressedHtml);
 }
开发者ID:ubnetdef,项目名称:auth_server,代码行数:9,代码来源:AppController.php

示例9: _output

 /**
  * Outputs the content of a scaffold method passing it through the Controller::afterFilter()
  *
  * @return void
  */
 protected function _output()
 {
     $this->controller->afterFilter();
     $this->controller->getResponse()->send();
 }
开发者ID:no2key,项目名称:Web-Framework-Benchmark,代码行数:10,代码来源:scaffold.php

示例10: afterFilter

 /**
  * Called after every controller action, and after rendering is complete.
  * This is the last controller method to run.
  *
  * @return void
  */
 public function afterFilter()
 {
     parent::afterFilter();
 }
开发者ID:saberhamidi,项目名称:cakephp-2.7.5,代码行数:10,代码来源:AppController.php

示例11: afterFilter

 /**
  * afterFilter callback
  * Disable debug mode on JSON pages to prevent the script execution time to be appended to the page
  *
  * @see http://croogo.lighthouseapp.com/projects/32818/tickets/216
  * @return void
  */
 public function afterFilter()
 {
     parent::afterFilter();
     if (!empty($this->params['url']['ext']) && $this->params['url']['ext'] === 'json') {
         Configure::write('debug', 0);
     }
 }
开发者ID:rchavik,项目名称:indent-all-the-things,代码行数:14,代码来源:app_controller.php

示例12: afterFilter

 function afterFilter()
 {
     parent::afterFilter();
     if (isset($_SERVER['HTTP_SF_AJAX_HEADER']) && $_SERVER['HTTP_SF_AJAX_HEADER'] == 'sfDialog') {
         unset($this->viewVars['controller']);
         $scripts = isset($this->jsResponse['script']) ? $this->jsResponse['script'] : array();
         $this->jsResponse = array();
         $this->jsResponse['id_display']['sfDialogModel_title'] = isset($this->viewVars['title']) ? $this->viewVars['title'] : '';
         $this->jsResponse['id_display']['sfDialogModel_body'] = $this->render();
         $this->jsResponse['script'][] = '$("#sfDialogModel").modal("show")';
         $this->jsResponse['script'][] = '$("#sfDialogModel").scrollTop(0);';
         foreach ($scripts as $script) {
             $this->jsResponse['script'][] = $script;
         }
         $this->renderJsResponse();
     } elseif (count($this->jsResponse) > 0) {
         $this->renderJsResponse();
     }
 }
开发者ID:pdkhuong,项目名称:BBG,代码行数:19,代码来源:AppController.php

示例13: afterFilter

 function afterFilter()
 {
     parent::afterFilter();
     $this->wildflowerCallback();
 }
开发者ID:Jaciss,项目名称:wildflower,代码行数:5,代码来源:app_controller.php

示例14: afterFilter

 public function afterFilter()
 {
     return parent::afterFilter();
 }
开发者ID:jgprolluxer,项目名称:prosales,代码行数:4,代码来源:AppController.php

示例15: afterFilter

 public function afterFilter()
 {
     parent::afterFilter();
     // sql logging to chrome console
     if (class_exists('ConnectionManager') && Configure::read('debug') >= 2) {
         App::import('Vendor', 'ChromePhp/ChromePhp');
         $sources = ConnectionManager::sourceList();
         $logs = array();
         foreach ($sources as $source) {
             $db = ConnectionManager::getDataSource($source);
             $logs[$source] = $db->getLog();
         }
         foreach ($logs as $source => $logInfo) {
             $text = $logInfo['count'] > 1 ? 'queries' : 'query';
             ChromePhp::info('------- SQL: ' . sprintf('(%s) %s %s took %s ms', $source, count($logInfo['log']), $text, $logInfo['time']) . ' -------');
             ChromePhp::info('------- REQUEST: ' . $this->request->params['controller'] . '/' . $this->request->params['action'] . ' -------');
             foreach ($logInfo['log'] as $k => $i) {
                 $i += array('error' => '');
                 if (!empty($i['params']) && is_array($i['params'])) {
                     $bindParam = $bindType = null;
                     if (preg_match('/.+ :.+/', $i['query'])) {
                         $bindType = true;
                     }
                     foreach ($i['params'] as $bindKey => $bindVal) {
                         if ($bindType === true) {
                             $bindParam .= h($bindKey) . " => " . h($bindVal) . ", ";
                         } else {
                             $bindParam .= h($bindVal) . ", ";
                         }
                     }
                     $i['query'] .= " , params[ " . rtrim($bindParam, ', ') . " ]";
                 }
                 $error = !empty($i['error']) ? "\nError: " . $i['error'] : "\n";
                 $logStr = $i['query'] . $error . "\nAffected: " . $i['affected'] . "\nNum. Rows: " . $i['numRows'] . "\nTook(ms): " . $i['took'] . "\n\n";
                 if (!empty($i['error'])) {
                     ChromePhp::error($logStr);
                 } else {
                     if ($i['took'] >= 100) {
                         ChromePhp::warn($logStr);
                     } else {
                         ChromePhp::info($logStr);
                     }
                 }
             }
         }
     }
 }
开发者ID:Demired,项目名称:CakeWX,代码行数:47,代码来源:AppController.php


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