当前位置: 首页>>代码示例>>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;未经允许,请勿转载。