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


PHP ActionFilter::afterAction方法代码示例

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


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

示例1: afterAction

 public function afterAction($action, $result)
 {
     $res = parent::afterAction($action, $result);
     if ($this->ajaxMode) {
         if ($res) {
             $dom = Yii::createObject(['class' => Dom::className(), 'html' => $res]);
             if (!empty($_REQUEST['target_id'])) {
                 $target_id = explode(',', $_REQUEST['target_id']);
                 $this->ajaxVars['html'] = $dom->getElementByIds($target_id);
             }
             list($scripts, $src) = $dom->getScripts();
             if ($scripts) {
                 $this->ajaxVars['scripts'] = $scripts;
             }
             if ($src && 0) {
                 // disabled
                 $this->ajaxVars['scripts_src'] = $src;
             }
         }
         // Flashes
         if (!isset($this->ajaxVars['alerts'])) {
             $this->ajaxVars['alerts'] = Yii::$app->session->getAllFlashes();
         }
         Yii::$app->response->format = 'json';
         return $this->ajaxVars;
     }
     return $res;
 }
开发者ID:vsguts,项目名称:crm,代码行数:28,代码来源:AjaxFilter.php

示例2: afterAction

 /**
  * This method is invoked right after an action is executed.
  * You may override this method to do some postprocessing for the action.
  * @param Action $action the action just executed.
  * @param mixed $result the action execution result
  * @return mixed the processed action result.
  */
 public function afterAction($action, $result)
 {
     $usedTime = microtime(TRUE) - $this->_startTime;
     $logContent = "Action:'{$action->uniqueId}' spent {$usedTime} seconds";
     $appLog = new AppLog(['log_content' => $logContent]);
     $appLog->save();
     return parent::afterAction($action, $result);
 }
开发者ID:xiaosongluffy,项目名称:yiilearn,代码行数:15,代码来源:ActionTimeFilter.php

示例3: afterAction

 public function afterAction($action, $result)
 {
     return parent::afterAction($action, $result);
 }
开发者ID:scorp7mix,项目名称:yii,代码行数:4,代码来源:FilterAdvert.php

示例4: afterAction

 public function afterAction($action, $result)
 {
     $time = microtime(true) - $this->_startTime;
     Yii::trace("Action '{$action->uniqueId}' spent {$time} second.");
     return parent::afterAction($action, $result);
 }
开发者ID:efabrikov,项目名称:test_yii2_basic,代码行数:6,代码来源:ActionTimeFilter.php

示例5: afterAction

 /**
  * @inheritdoc
  */
 public function afterAction($action, $result)
 {
     $parentsResults = parent::afterAction($action, $result);
     Url::rememberStack();
     return $parentsResults;
 }
开发者ID:bruno-melo,项目名称:components,代码行数:9,代码来源:RememberUrl.php


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