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