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


PHP ActionFilter::init方法代碼示例

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


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

示例1: init

 /**
  * 初始化方法
  */
 public function init()
 {
     parent::init();
     //獲取user實例
     $this->user = Instance::ensure($this->user, User::className());
     $this->user_info = $this->user->identity;
 }
開發者ID:wangpengzhen,項目名稱:web,代碼行數:10,代碼來源:RbacControl.php

示例2: init

 public function init()
 {
     parent::init();
     if ($this->allowActions && $this->denyActions) {
         throw new \yii\base\InvalidConfigException("allowActions and denyActions only one can be set");
     }
 }
開發者ID:Jasmine2,項目名稱:yii2-rest-wall,代碼行數:7,代碼來源:AccessControl.php

示例3: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if ($this->view === null) {
         $this->view = Yii::$app->getView();
     }
 }
開發者ID:manyoubaby123,項目名稱:imshop,代碼行數:10,代碼來源:ActionCache.php

示例4: init

 /**
  * Initializes the [[rules]] array by instantiating rule objects from configurations.
  */
 public function init()
 {
     parent::init();
     $this->user = Instance::ensure($this->user, User::className());
     if ($this->user->identity !== null) {
         $this->user->identity->getRules();
     }
 }
開發者ID:rajanishtimes,項目名稱:basicyii,代碼行數:11,代碼來源:AccessControl.php

示例5: init

 /**
  * Initializes the [[rules]] array by instantiating rule objects from configurations.
  */
 public function init()
 {
     parent::init();
     foreach ($this->rules as $i => $rule) {
         if (is_array($rule)) {
             $this->rules[$i] = Yii::createObject(array_merge($this->ruleConfig, $rule));
         }
     }
 }
開發者ID:davidpersson,項目名稱:FrameworkBenchmarks,代碼行數:12,代碼來源:AccessControl.php

示例6: init

 public function init()
 {
     /** @var $module Module */
     if (empty($this->user) && ($module = Yii::$app->getModule('admin')) != null) {
         $this->user = $module->adminComponent;
     }
     ActionFilter::init();
     if (empty($this->rules)) {
         $this->rules = [['actions' => [], 'allow' => true, 'roles' => ['@']]];
     }
     $this->user = Instance::ensure($this->user, User::className());
     foreach ($this->rules as $i => $rule) {
         if (is_array($rule)) {
             $this->rules[$i] = Yii::createObject(array_merge($this->ruleConfig, $rule));
         }
     }
 }
開發者ID:NullRefExcep,項目名稱:yii2-admin,代碼行數:17,代碼來源:AccessControl.php

示例7: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     $this->user = Instance::ensure($this->user, User::className());
 }
開發者ID:BakhtiyorRuziev,項目名稱:yii2-admin,代碼行數:8,代碼來源:AccessControl.php

示例8: init

 /**
  * Initializes the [[rules]] array by instantiating rule objects from configurations.
  */
 public function init()
 {
     parent::init();
     $this->user = Instance::ensure($this->user, User::className());
     foreach ($this->rules as $i => $rule) {
         if (is_array($rule)) {
             $this->rules[$i] = Yii::createObject(array_merge($this->ruleConfig, $rule));
         }
     }
 }
開發者ID:phpsong,項目名稱:yii2song,代碼行數:13,代碼來源:GlobalAccessControl.php

示例9: init

 public function init()
 {
     parent::init();
     $this->user = Yii::$app->getSession()->get('user');
 }
開發者ID:krissss,項目名稱:YunDou-advanced,代碼行數:5,代碼來源:OperationFilter.php

示例10: init

 public function init()
 {
     parent::init();
 }
開發者ID:krissss,項目名稱:YunDou-advanced,代碼行數:4,代碼來源:OpenIdFilter.php

示例11: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     $this->initAllowActions();
 }
開發者ID:mg-code,項目名稱:yii2-auth,代碼行數:8,代碼來源:AccessControl.php

示例12: init

 public function init()
 {
     parent::init();
     $this->rulesMap = (require __DIR__ . '/rulesMap.php');
 }
開發者ID:JiltImageBoard,項目名稱:jilt-backend,代碼行數:5,代碼來源:CpAccessControl.php


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