/** * * @param string $id the ID of this controller. * @param Module $module the module that this controller belongs to. * @param array $config name-value pairs that will be used to initialize the object properties. */ public function __construct($id, $module, $config = []) { $this->id = $id; $this->module = $module; parent::__construct($config); }
/** * Constructor. * * @param string $id the ID of this action * @param Controller $controller the controller that owns this action * @param array $config name-value pairs that will be used to initialize the object properties */ public function __construct($id, $controller, $config = []) { $this->id = $id; $this->controller = $controller; parent::__construct($config); }
/** * @inheritdoc */ public function __construct($config = []) { // ensure logger gets set before any other config option if (isset($config['logger'])) { $this->setLogger($config['logger']); unset($config['logger']); } // connect logger and dispatcher $this->getLogger(); parent::__construct($config); }
/** * 构造方法 * * @param array $config name-value pairs that will be used to initialize the object properties. * Note that the configuration must contain both [[id]] and [[basePath]]. * @throws InvalidConfigException if either [[id]] or [[basePath]] configuration is missing. */ public function __construct($config = []) { Leaps::$app = $this; $this->setInstance($this); $this->state = self::STATE_BEGIN; $this->preInit($config); $this->registerErrorHandler($config); Service::__construct($config); }