當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。