當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Controller::afterAction方法代碼示例

本文整理匯總了PHP中yii\web\Controller::afterAction方法的典型用法代碼示例。如果您正苦於以下問題:PHP Controller::afterAction方法的具體用法?PHP Controller::afterAction怎麽用?PHP Controller::afterAction使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在yii\web\Controller的用法示例。


在下文中一共展示了Controller::afterAction方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: afterAction

 /**
  * @inheritdoc
  */
 public function afterAction($action, $result)
 {
     if ($this->_oldMailPath !== null) {
         Yii::$app->getMailer()->setViewPath($this->_oldMailPath);
     }
     return parent::afterAction($action, $result);
 }
開發者ID:DiegoRodriguezTandil,項目名稱:MoisesVille,代碼行數:10,代碼來源:UserController.php

示例2: afterAction

 public function afterAction($action, $result)
 {
     if (self::$isStatistic) {
         (new Query())->createCommand()->insert('timer', ['action_id' => $action->id, 'controller_id' => $this->id, 'date_time' => gmdate('YmdHis'), 'timer' => microtime(true) - $this->markDownCounter])->execute();
     }
     return parent::afterAction($action, $result);
 }
開發者ID:Makeyko,項目名稱:galaxysss,代碼行數:7,代碼來源:BaseController.php

示例3: afterAction

 /**
  * @param \yii\base\Action $action
  * @param mixed $result
  * @return mixed
  */
 public function afterAction($action, $result)
 {
     if ($this->session->isActive) {
         $this->session->close();
     }
     return parent::afterAction($action, $result);
 }
開發者ID:jc21,項目名稱:snippets-site,代碼行數:12,代碼來源:Controller.php

示例4: afterAction

 public function afterAction($action, $result)
 {
     echo 'before action<br>';
     echo 'test<br>';
     return parent::afterAction($action, $result);
     // TODO: Change the autogenerated stub
 }
開發者ID:tqsq2005,項目名稱:Yii2adv,代碼行數:7,代碼來源:TestController.php

示例5: afterAction

 public function afterAction($action, $result)
 {
     $result = parent::afterAction($action, $result);
     if ($action->id != 'error' && Extension_Loaded('zlib')) {
         Ob_End_Flush();
     }
     return $result;
 }
開發者ID:Ethennoob,項目名稱:yii2-blog,代碼行數:8,代碼來源:BaseController.php

示例6: afterAction

 public function afterAction($action, $result)
 {
     parent::afterAction($action, $result);
     if (Yii::$app->response->format == Response::FORMAT_JSON) {
         header('Content-Type: application/json');
         return $this->ajaxResponse;
     }
     return null;
 }
開發者ID:Konsul117,項目名稱:phonebook,代碼行數:9,代碼來源:AddressController.php

示例7: afterAction

 /**
  * @inheritdoc
  */
 public function afterAction($action, $result)
 {
     // save log
     $log = new models\api\Log();
     $log->status = models\api\Log::STATUS_SUCCESS;
     $log->save();
     // generate answer
     $data = ['status' => models\api\Log::STATUS_SUCCESS, 'data' => $result];
     return parent::afterAction($action, $data);
 }
開發者ID:vadoss,項目名稱:hryvna-today,代碼行數:13,代碼來源:V1Controller.php

示例8: afterAction

 public function afterAction($action, $result)
 {
     $result = parent::afterAction($action, $result);
     // your custom code here
     $obResult = ob_get_clean();
     if (!empty($obResult)) {
         // 所有actionXxx中 如果出現 echo print dump 等向緩存輸出內容的調用 將走此邏輯
         return $this->renderContent($obResult);
         // return $obResult ;
     }
     return $result;
 }
開發者ID:cjq,項目名稱:yii2-playground,代碼行數:12,代碼來源:SsdbController.php

示例9: afterAction

 /**
  * Executed after action
  * @author Adegoke Obasa <goke@cottacush.com>
  * @param \yii\base\Action $action
  * @param mixed $result
  * @return mixed
  */
 public function afterAction($action, $result)
 {
     $result = parent::afterAction($action, $result);
     $this->setSecurityHeaders();
     /**
      * Set Current Transaction in New Relic
      * @author Adegoke Obasa <goke@cottacush.com>
      */
     if (extension_loaded('newrelic')) {
         newrelic_name_transaction($action->controller->id . '/' . $action->id);
     }
     return $result;
 }
開發者ID:cottacush,項目名稱:yii2-base-project,代碼行數:20,代碼來源:BaseController.php

示例10: afterAction

 /**
  * @inheritdoc
  */
 public function afterAction($action, $result)
 {
     $result = parent::afterAction($action, $result);
     if ($result) {
         return $result;
     }
     $session = Yii::$app->session;
     if ($session->isActive) {
         $session->close();
     }
     $this->view->registerAssetBundle($this->assetName);
     $this->data('tpl', $this->_tpl . '.tpl');
     $this->forceSetTitle();
     return $this->renderPartial('@app/views/index.tpl', $this->_data);
 }
開發者ID:miptliot,項目名稱:vps-tools,代碼行數:18,代碼來源:WebController.php

示例11: afterAction

 public function afterAction($action, $result)
 {
     /**
      * @var $user \common\models\User
      */
     if (!\Yii::$app->user->isGuest) {
         $user = \Yii::$app->user->identity;
         // если у пользователя изменили данные и не сохранили, то сохраняем,
         // один из вариантов обновления без сохранения смотреть в методе чуть выше beforeAction
         if ($user->getDirtyAttributes()) {
             $user->update();
         }
     }
     return parent::afterAction($action, $result);
     // TODO: Change the autogenerated stub
 }
開發者ID:KPEMATOP,項目名稱:findspree_old,代碼行數:16,代碼來源:Controller.php

示例12: afterAction

 public function afterAction($action, $result)
 {
     $errorHandler = Yii::$app->get('errorHandler');
     if (!empty($errorHandler->exception)) {
         $this->handleException($errorHandler->exception);
     }
     $result = parent::afterAction($action, $result);
     if ($this->response->getStatusCode() == 200) {
         return $this->respondByFormat();
     }
     return $result;
 }
開發者ID:heartshare,項目名稱:yii2-liuxy-extension,代碼行數:12,代碼來源:WebController.php

示例13: afterAction

 public function afterAction($action, $result)
 {
     U::W("{$this->id}/{$this->action->id}:" . Yii::getLogger()->getElapsedTime());
     return parent::afterAction($action, $result);
 }
開發者ID:noikiy,項目名稱:wowewe,代碼行數:5,代碼來源:WxpaynotifyController.php

示例14: afterAction

 /**
  * @inheritdoc
  */
 public function afterAction($action, $result)
 {
     \Yii::endProfile('jsonrpc.controller.' . $action->id);
     return parent::afterAction($action, $result);
 }
開發者ID:eugene-khorev,項目名稱:yii2-json-rpc-controller,代碼行數:8,代碼來源:Controller.php

示例15: afterAction

 /**
  * @inheritdoc
  */
 public function afterAction($action, $result)
 {
     $result = parent::afterAction($action, $result);
     return $this->serializeData($result);
 }
開發者ID:Jaaviieer,項目名稱:PrograWeb,代碼行數:8,代碼來源:Controller.php


注:本文中的yii\web\Controller::afterAction方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。