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


PHP CController::afterAction方法代码示例

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


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

示例1: afterAction

 protected function afterAction($action)
 {
     $time = sprintf('%0.5f', Yii::getLogger()->getExecutionTime());
     $memory = round(memory_get_peak_usage() / (1024 * 1024), 2) . "MB";
     echo '<!-- Time: ' . $time . 'ms, memory: ' . $memory . '-->';
     parent::afterAction($action);
 }
开发者ID:lp19851119,项目名称:114la,代码行数:7,代码来源:Controller.php

示例2: afterAction

 protected function afterAction($action)
 {
     parent::afterAction($action);
     if (!$this->readOnly) {
         Yii::app()->unitOfWork->commit();
     }
 }
开发者ID:njxjxj,项目名称:yorm,代码行数:7,代码来源:CUController.php

示例3: afterAction

 public function afterAction($action)
 {
     ## Make sure service daemon is started
     if (!ServiceManager::checkDaemon()) {
         ServiceManager::startDaemon();
     }
     parent::afterAction($action);
     return true;
 }
开发者ID:rizabudi,项目名称:plansys,代码行数:9,代码来源:Controller.php

示例4: afterAction

 /**
  * @name  afterAction
  * @var $action
  * 
  */
 public function afterAction($action)
 {
     parent::afterAction($action);
     if (Yii::app()->params['statistik']) {
         if ('site.updatemsg' != $this->getId() . '.' . $action->id) {
             Yii::log($this->getTimeStamp() . '.' . $this->getId() . '.' . $action->id . ',' . Yii::app()->user->name . ',' . $_SERVER['REMOTE_ADDR'], 'info', 'statistik');
         }
     }
 }
开发者ID:asdmundt,项目名称:templateYiiApp,代码行数:14,代码来源:Controller.php

示例5: afterAction

 public function afterAction($action)
 {
     parent::afterAction($action);
 }
开发者ID:BrunoCheble,项目名称:novopedido,代码行数:4,代码来源:Controller.php

示例6: afterAction

 public function afterAction($action)
 {
     if ($this->isActionAttachedByActionsMethod($action)) {
         return parent::afterAction($action);
     }
     $this->renderAndLogResponse();
     return parent::afterAction($action);
 }
开发者ID:rosko,项目名称:backvendor,代码行数:8,代码来源:CWebserviceController.php

示例7: afterAction

 protected function afterAction($action)
 {
     $this->viewStatistic->run();
     parent::afterAction($action);
     // TODO: Change the autogenerated stub
 }
开发者ID:jankichaudhari,项目名称:yii-site,代码行数:6,代码来源:PublicController.php

示例8: afterAction

 /**
  * Checks request type and call response.
  *
  * @param $action
  */
 protected function afterAction($action)
 {
     if ($this->error == null && !$this->isFromCache) {
         if ($this->beforeToArray && is_callable($this->beforeToArray)) {
             call_user_func($this->beforeToArray, $this->data);
         }
         $this->toArray();
         if ($this->action instanceof IPostProcessable) {
             $this->action->postProcessing($this->data);
             if (is_array($this->data) && count($this->data) == 0) {
                 throw new NotFoundApiException();
             }
         }
         if ($this->requestType == 'Param') {
             \Yii::app()->apiCache->set($this->key, $this->data, self::CACHE_EXPIRE);
             $this->setModelCollectionCache();
             $this->setHeadersCache();
         }
     }
     if ($this->checkRequestType('GET') && $this->action instanceof IViewIncrementable) {
         if ($this->action->viewsIncrement() && $this->isFromCache) {
             \Yii::app()->apiCache->delete($this->key);
         }
     }
     //if data contains 1 element - returns object, not array. except get pagination request.
     /**@todo: bad idea, need refactor*/
     if (!$this->checkRequestType('GET') || \Yii::app()->request->getParam('id', null) || \Yii::app()->request->getParam('url', null)) {
         if ($this->error == null && $this->data != null && is_array($this->data) && count($this->data) == 1) {
             $this->data = $this->data[0];
         }
     }
     $this->complete();
     parent::afterAction($action);
 }
开发者ID:JimmDiGriz,项目名称:HGApi,代码行数:39,代码来源:CoreApiController.php

示例9: afterAction

 /**
  * This method is invoked right after an action is executed.
  * You may override this method to do some postprocessing for the action.
  * @param CAction $action the action just executed.
  */
 protected function afterAction($action)
 {
     SourceBans::app()->trigger('app.afterAction', new CEvent($this, array('action' => $action)));
     parent::afterAction($action);
 }
开发者ID:Saltly,项目名称:SourceBans,代码行数:10,代码来源:Controller.php


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