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