Init pages array
@throws \yii\base\InvalidConfigException
480672
private static function initPages()
    {
        $modelPage = Yii::createObject(Page::class);
        $pages = $modelPage::find()->getMap()->asArray()->all();

        if ($pages) {
            foreach ($pages as $page) {
                self::$pages[$page['id']] = $page;
            }
        }

    }
154523
public function init()
	{
		parent::init();
		foreach($this->_routes as $name=>$route)
		{
			$route=Yii::createComponent($route);
			$route->init();
			$this->_routes[$name]=$route;
		}
		Yii::getLogger()->attachEventHandler('onFlush',array($this,'collectLogs'));
		Yii::app()->attachEventHandler('onEndRequest',array($this,'processLogs'));
	}
416887
public function init()
    {
        if (empty($this->serviceUrl)) {
            throw new InvalidConfigException("service_url cannot be empty. Please configure.");
        }
        if (empty($this->apiKey)) {
            throw new InvalidConfigException("api_key cannot be empty. Please configure.");
        }
        if ($this->cache) {
            // If class was specified as name, try to instantiate on application
            if (is_string($this->cache) && Yii::$app->has($this->cache)) {
                $this->cache = Yii::$app->get($this->cache);
            } elseif (is_array($this->cache)) {
                $this->cache = Yii::createObject($this->cache);
            }
        } elseif ($this->cache !== false && isset(Yii::$app->cache)) {
            $this->cache = Yii::$app->cache;
        }
        $this->_client = new \yii\httpclient\Client([
            'baseUrl' => $this->serviceUrl,
            'requestConfig' => [
                'method' => 'POST',
                'data' => [
                    'ApiKey' => $this->apiKey
                ]
            ],
            'responseConfig' => [
                'format' => \yii\httpclient\Client::FORMAT_XML
            ]
        ]);

        if ($this->requestIp) {
            $validator = new IpValidator([
                'ipv6' => true,
                'ipv4' => true,
                'subnet' => false,
                'expandIPv6' => true
            ]);
            if ($validator->validate($this->requestIp)) {
                ArrayHelper::setValue($this->_client->requestConfig, 'options.bindto', $this->requestIp);
            }
        }

        $result = $this->checkApiKey();
        if (!is_array($result) || empty($result) || strpos($result[0], 'not accepted') !== false) {
            throw new InvalidConfigException(
                "Api Key seems to be invalid: {$result[0]}",
                Exception::E_API_INVALID_PARAMETER
            );
        }
    }
1281062
public function init ()
		{
			$access = ( !is_null(Yii::$app->getModule('users')) and Yii::$app->getModule('users')->useAccessControl );
			$rules = [
				[
					'allow'       => true,
					'actions'     => [ 'index' ],
					'controllers' => [ 'site' ],
					'roles'       => [ '?', '@' ]
				],
				[
					'allow'        => true,
					'actions'      => [ 'auth', 'login' ],
					'controllers'  => [ 'user' ],
					'roles'        => [ '?' ],
					'denyCallback' => function ($rule, $action) { Yii::$app->notification->error(Yii::tr('You are already logged in.')); },
				],
				[
					'allow'         => true,
					'actions'       => [],
					'controllers'   => [],
					'roles'         => [ '@' ],
					'matchCallback' => function ($rule, $action)
					{

						if (!Yii::$app->user->identity->active)
						{
							Yii::$app->notification->errorToSession(Yii::tr('Your account is not approved yet.', [], 'user'));
							$action->controller->redirect(Url::toRoute([ '/site/index' ]));
						}

						return true;
					}
				],
			];

			if ($access)
				foreach (Yii::$app->getModule('users')->allowedUnauthorizedRoutes as $url)
				{
					$url = explode('/', trim($url, '/'));
					array_push($rules, [
						'allow'       => true,
						'actions'     => [ array_pop($url) ],
						'controllers' => [ array_shift($url) ],
						'roles'       => [ '?', '@' ]
					]);
				}

			if ($access or count($this->rules) == 0)
				foreach ($rules as $rule)
				{
					if (is_array($rule))
					{
						array_push($this->rules, Yii::createObject(array_merge($this->ruleConfig, $rule)));
					}
				}
			parent::init();
		}
33822
public function init()
    {
        if (!$this->isEnabled() || $this->getUser()->isGuest) {
            return;
        }

        $this->userSwitch = new UserSwitch(['userComponent' => $this->userComponent]);
        $this->addAccessRules();

        if (!is_object($this->filterModel)
            && class_exists($this->filterModel)
            && in_array('yii\debug\models\search\UserSearchInterface', class_implements($this->filterModel), true)
        ) {
            $this->filterModel = new $this->filterModel;
        } elseif ($this->getUser() && $this->getUser()->identityClass) {
            if (is_subclass_of($this->getUser()->identityClass, 'yii\db\ActiveRecord')) {
                $this->filterModel = new \yii\debug\models\search\User();
            }
        }
    }
30943
public function init()
    {
        if ($this->model === null) {
            throw new InvalidConfigException('Please specify the "model" property.');
        }

        $this->dataProvider = new ArrayDataProvider(['allModels' => [$this->model]]);
        parent::init();
    }
216494
public function init()
    {
        $this->registerMyJs();
        $display_none = '';

        if (ArrayHelper::remove($this->options, 'displayNone', true) === true) {
            $display_none = Yii::$app->request->get($this->model->formName())['search_form'] ? '' : 'display:none';
        }

        if ($this->submitButtonWrapperOptions !== false) {
            $this->submitButtonWrapperOptions = ArrayHelper::merge([
                'class' => 'col-md-12',
            ], $this->submitButtonWrapperOptions);
        }

        $tag = ArrayHelper::remove($this->options, 'tag', 'div');
        echo Html::beginTag($tag, ArrayHelper::merge([
            'id'    => $this->getDivId(),
            'class' => 'row',
            'style' => 'margin-bottom: 1rem; margin-top: 1rem; ' . $display_none,
        ], $this->options));

        $this->_form = ActiveForm::begin([
            'id'        => 'form-' . $this->getDivId(),
            'action'    => $this->action,
            'method'    => $this->method,
            'options'   => $this->formOptions,
            'fieldClass' => AdvancedSearchActiveField::class,
        ]);
        echo Html::hiddenInput(Html::getInputName($this->model, 'search_form'), 1);
    }
919311
public function init() {
		parent::init();

		// EAuth component
		$component = Yii::app()->getComponent($this->component);

		// Some default properties from component configuration
		if (!isset($this->services)) {
			$this->services = $component->getServices();
		}

		if (is_array($this->predefinedServices)) {
			$_services = array();
			foreach ($this->predefinedServices as $_serviceName) {
				if (isset($this->services[$_serviceName])) {
					$_services[$_serviceName] = $this->services[$_serviceName];
				}
			}
			$this->services = $_services;
		}

		if (!isset($this->popup)) {
			$this->popup = $component->popup;
		}

		// Set the current route, if it is not set.
		if (!isset($this->action)) {
			$this->action = Yii::app()->urlManager->parseUrl(Yii::app()->request);
		}
	}
70816
public function init()
    {
        if ($this->pagination === null) {
            throw new InvalidConfigException('The "pagination" property must be set.');
        }

        if ($this->widgetId === null) {
            throw new InvalidConfigException('The "widgetId" property must be set.');
        }

        // Publish assets and register main plugin code
        InfiniteScrollAsset::register($this->view);

        // Register configured behavior, if any
        $behavior = ArrayHelper::getValue($this->pluginOptions, 'behavior', null);
        if (!is_null($behavior)) {
            switch ($behavior) {
                case self::BEHAVIOR_TWITTER:
                    $behaviorAsset = 'manual-trigger.js';
                    break;
                case self::BEHAVIOR_LOCAL:
                    $behaviorAsset = 'local.js';
                    break;
                case self::BEHAVIOR_MASONRY:
                    $behaviorAsset = 'masonry-isotope.js';
                    break;
                case self::BEHAVIOR_CUFON:
                    $behaviorAsset = 'cufon.js';
                    break;
                default:
                    $behaviorAsset = false;
            }
            if ($behaviorAsset) {
                $assetManager = $this->view->getAssetManager();
                $assetBundle = $assetManager->getBundle(InfiniteScrollAsset::className());
                $behaviorUrl = $assetManager->getAssetUrl($assetBundle, 'behaviors/' . $behaviorAsset);
                $this->view->registerJsFile($behaviorUrl, [
                    'depends' => [InfiniteScrollAsset::className()]
                ]);
            }
        }

        $widgetSelector = '#' . $this->widgetId;

        // Set default plugin selectors / options if not configured
        if (is_null(ArrayHelper::getValue($this->pluginOptions, 'maxPage', null)))
            $this->pluginOptions['maxPage'] = $this->pagination->getPageCount();

        if (is_null(ArrayHelper::getValue($this->pluginOptions, 'contentSelector', null)))
            $this->pluginOptions['contentSelector'] = $widgetSelector . ' .' . $this->itemsCssClass;

        if (is_null(ArrayHelper::getValue($this->pluginOptions, 'itemSelector', null)))
            $this->pluginOptions['itemSelector'] = $this->pluginOptions['contentSelector'] . ' >';

        if (is_null(ArrayHelper::getValue($this->pluginOptions, 'navSelector', null)))
            $this->pluginOptions['navSelector'] = $widgetSelector . " ul." . $this->options['class'];

        if (is_null(ArrayHelper::getValue($this->pluginOptions, 'nextSelector', null)))
            $this->pluginOptions['nextSelector'] = $this->pluginOptions['navSelector'] . ' li.' . $this->nextPageCssClass . " a:first";

        if (is_null(ArrayHelper::getValue($this->pluginOptions, 'loading', null)))
            $this->pluginOptions['loading'] = [];
        if (is_null(ArrayHelper::getValue($this->pluginOptions['loading'], 'img', null))) {
            $assetManager = $this->view->getAssetManager();     // Publish loader img
            list ($imgPath, $imgUrl) = $assetManager->publish('@vendor/nirvana-msu/yii2-infinite-scroll/assets/images/ajax-loader.gif');
            $this->pluginOptions['loading']['img'] = $imgUrl;
        }
    }
515819
public function init()
    {
        if (is_string($this->config)) {
            throw new InvalidConfigException('"config" must be of type array.');
        }
        $this->assets = array(
            'js' => YII_DEBUG ? 'foundation/foundation.alerts.js' : 'foundation.min.js'
        );

        if (!isset($this->config)) {
            $this->config = array(
                Enum::COLOR_REGULAR   => array(),
                Enum::COLOR_ALERT     => array(),
                Enum::COLOR_SECONDARY => array(),
                Enum::COLOR_SUCCESS   => array(),
            );
        }
        $this->htmlOptions = ArrayHelper::defaultValue('id', $this->getId(), $this->htmlOptions);
        parent::init();
    }
342520
public function initConfig ()
    {
        if (empty(Yii::$app->params['domain'])) {
            throw new InvalidConfigException("param `domain` must set.", 1);
        }
        $this->_config = $this->mergeConfig();
        $config = Json::htmlEncode($this->_config);
        $js = <<<JS
            var {$this->_hashVar} = {$config};
            $('#{$this->_hashVar}').webupload_fileinput({$this->_hashVar});
JS;
        $this->_view->registerJs($js);
    }
653107
protected function initColumns()
    {
        foreach ($this->columns as $i => $column) {
            $definition = array_merge([
                'class'         => $this->columnClass,
                'renderer'      => $this,
                'context'       => $this->context,
            ], $column);

            $this->addButtonOptions = (array)$this->addButtonOptions;

            if (!isset($definition['attributeOptions'])) {
                $definition['attributeOptions'] = $this->attributeOptions;
            }

            if (!isset($definition['enableError'])) {
                $definition['enableError'] = $this->enableError;
            }

            $this->columns[$i] = Yii::createObject($definition);
        }
    }
1058532
public function init()
	{
		// Prevents the extension from registering scripts and publishing assets when ran from the command line.
		if (Yii::$app instanceof \yii\console\Application){
			return;
		}
		parent::init();
		Yii::setAlias('djfly/kindeditor', dirname(dirname(__DIR__)) . '/djfly/kindeditor');
	}
766716
public function init()
    {
        parent::init();

        if ($this->useSessionFlash) {
            $session = Yii::$app->getSession();
            $flashes = $session->getAllFlashes();

            foreach ($flashes as $type => $data) {
                $data = (array) $data;
                foreach ($data as $message) {
                    $this->options['type'] = $type;
                    $this->options['title'] = $message;
                }
                $session->removeFlash($type);
            }
        } else {
            if (!$this->hasTitle()) {
                throw new InvalidConfigException("The 'title' option is required.");
            }
        }
    }
39896
public function init()
    {
        parent::init();

        if ($this->url === null) {
            throw new InvalidConfigException("You must setup the 'Url' property.");
        }

        if (!isset($this->options['id'])) {
            $this->options['id'] = $this->hasModel() ? Html::getInputId($this->model, $this->attribute) : $this->getId();
        }
    }
509116
public function init() {		
		\frenzelgmbh\cmcategories\categoriesAsset::register(\Yii::$app->view);
		return parent::init();
	}
442638
public function init()
	{
		parent::init();

		if (empty($this->statusAttribute)) {
			throw new InvalidConfigException('The "statusAttribute" configuration for the Behavior is required.');
		}

		// init source
		
		if (empty($this->source)) {
			throw new InvalidConfigException('The "source" configuration for the Behavior can\'t be empty.');
		} elseif (  ! Yii::$app->has($this->source)) {
			Yii::$app->set($this->source, ['class'=> self::DEFAULT_SOURCE_CLASS]);
		}
		$this->_wfSource = Yii::$app->get($this->source);

		// init Event Sequence
		
		if ( $this->eventSequence == null) {
			$this->_eventSequence = null;
		} elseif ( is_string($this->eventSequence)) {
			if (  ! Yii::$app->has($this->eventSequence)) {
				Yii::$app->set($this->eventSequence, ['class'=> self::DEFAULT_EVENT_SEQUENCE_CLASS]);
			}
			$this->_eventSequence = Yii::$app->get($this->eventSequence);
		} else {
			throw new InvalidConfigException('Invalid "eventSequence" value.');
		}
	}