yii\web\User::init PHP Method

init() public method

Initializes the application component.
public init ( )
    public function init()
    {
        parent::init();
        if ($this->identityClass === null) {
            throw new InvalidConfigException('User::identityClass must be set.');
        }
        if ($this->enableAutoLogin && !isset($this->identityCookie['name'])) {
            throw new InvalidConfigException('User::identityCookie must contain the "name" element.');
        }
    }

Usage Example

Beispiel #1
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     if ($this->identityClass == null) {
         $this->identityClass = \Yii::$app->getModule('user')->factory->userClass;
     }
     parent::init();
 }
All Usage Examples Of yii\web\User::init