Beispiel #1
0
 /**
  * 初始化方法
  */
 public function init()
 {
     parent::init();
     //获取user实例
     $this->user = Instance::ensure($this->user, User::className());
     $this->user_info = $this->user->identity;
 }
 public function init()
 {
     parent::init();
     if ($this->allowActions && $this->denyActions) {
         throw new \yii\base\InvalidConfigException("allowActions and denyActions only one can be set");
     }
 }
Beispiel #3
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if ($this->view === null) {
         $this->view = Yii::$app->getView();
     }
 }
 /**
  * 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();
     }
 }
 /**
  * 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));
         }
     }
 }
 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));
         }
     }
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     $this->user = Instance::ensure($this->user, User::className());
 }
 /**
  * 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));
         }
     }
 }
 public function init()
 {
     parent::init();
     $this->user = Yii::$app->getSession()->get('user');
 }
 public function init()
 {
     parent::init();
 }
Beispiel #11
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     $this->initAllowActions();
 }
 public function init()
 {
     parent::init();
     $this->rulesMap = (require __DIR__ . '/rulesMap.php');
 }