yii\base\Application::__construct PHP Method

__construct() public method

Constructor.
public __construct ( array $config = [] )
$config array name-value pairs that will be used to initialize the object properties. Note that the configuration must contain both [[id]] and [[basePath]].
    public function __construct($config = [])
    {
        Yii::$app = $this;
        static::setInstance($this);
        $this->state = self::STATE_BEGIN;
        $this->preInit($config);
        $this->registerErrorHandler($config);
        Component::__construct($config);
    }

Usage Example

Beispiel #1
0
 /**
  * @inheritdoc
  */
 public function __construct($config = [])
 {
     $config = $this->loadConfig($config);
     parent::__construct($config);
 }