Registers JS code to help initialize Select2 widgets
with access to netis\crud\crud\ActiveController API.
@param \yii\web\View $view
343754
public static function registerSelect($view)
    {
        $script = <<<JavaScript
(function (s2helper, $, undefined) {
    "use strict";
    s2helper.formatResult = function (result, container, query, escapeMarkup, depth) {
        if (typeof depth == 'undefined') {
            depth = 0;
        }
        var markup = [];
        window.Select2.util.markMatch(result._label, query.term, markup, escapeMarkup);
        return markup.join("");
    };

    s2helper.formatSelection = function (item) {
        return item._label;
    };

    // generates query params
    s2helper.data = function (term, page) {
        return { search: term, page: page };
    };

    // builds query results from ajax response
    s2helper.results = function (data, page) {
        return { results: data.items, more: page < data._meta.pageCount };
    };

    s2helper.getParams = function (element) {
        var primaryKey = element.data('relation-pk');
        if (typeof primaryKey === 'undefined' || primaryKey === null) {
            primaryKey = 'id';
        }

        var params = {search: {}};
        params.search[primaryKey] = element.val();
        return params;
    };

    s2helper.initSingle = function (element, callback) {
        $.getJSON(element.data('select2').opts.ajax.url, s2helper.getParams(element), function (data) {
            if (typeof data.items[0] != 'undefined') {
                callback(data.items[0]);
            }
        });
    };

    s2helper.initMulti = function (element, callback) {
        $.getJSON(element.data('select2').opts.ajax.url, s2helper.getParams(element), function (data) {callback(data.items);});
    };
}( window.s2helper = window.s2helper || {}, jQuery ));
JavaScript;
        $view->registerJs($script, \yii\web\View::POS_END, 'netis.s2helper');
        \maddoger\widgets\Select2BootstrapAsset::register($view);
    }
377622
public function compose(View $view)
    {
        $userGroupRepository = app(UserGroupInterface::class);
        $userGroupOptions = $userGroupRepository->all()->pluck('name', 'id');
        $view->with('userGroupOptions', $userGroupOptions);
    }
1299586
public function compile(JsUtils $js=NULL,&$view=NULL){
		$this->insertItem(new HtmlIcon("", "left chevron"));
		$this->addItem(new HtmlIcon("", "right chevron"));
		$this->asPagination();
		return parent::compile($js,$view);
	}
223351
public function compose(View $view)
    {
        if (Session::has('multi_language_enabled')) {
            $languages = Session::get('languages');
            $defaultLanguage = Session::get('default_language');
            $langId = request()->get('language_id', $defaultLanguage->id);
            $isDefaultLang = ($defaultLanguage->id == $langId) ? true : false;
        }
        $view->withDefaultLanguage($defaultLanguage)
            ->withLanguages($languages)
            ->withIsDefaultLang($isDefaultLang);
    }
296881
public function setTemplateInheritorsCssToUpdate(View $view)
    {
        if (!($view instanceof Template)) {
            return;
        }
        foreach ($view->getInheritors() as $inheritor) {
            $inheritor->setCssUpToDate(false);
            $this->uow->persist($inheritor);
            $this->setTemplateInheritorsCssToUpdate($inheritor);
        }
    }
195955
public function compose(View $view)
    {
        $status = $this->system->getStatus();

        $view->withSystemStatus(Arr::get($status, 'system_status'));
        $view->withSystemMessage(Arr::get($status, 'system_message'));
    }
1150364
public function view($view = null, $layout = null)
    {
        if (! is_null($layout)) {
            $this->layoutOptions = [
                'default' => $layout,
                'ajax'    => $layout,
            ];
        }

        // Set up the default view resolution
        viewBuilder()->setUp($this->layoutOptions, $view);
        $this->setupLayout();
    }
581000
public function registerAssetFiles($view)
    {
        $this->css = [$this->url . $this->version . '/styles/' . $this->style];
        $this->js = [$this->url . $this->version . '/highlight.min.js'];
        
        parent::registerAssetFiles($view);
    }
521505
protected function makeView($view)
    {
        if( Auth::check() ) {
            $this->addParameter( 'activeUser', Auth::user() );
        }

        return View::make( $view, $this->parameters );
    }
7330
public function setView($view, $variables = [])
    {
        if (!empty($variables)) {
            $this->with($variables);
        }

        $this->view = $view;
    }
862649
public function dropAndCreateView(View $view)
    {
        $this->tryMethod('dropView', $view->getQuotedName($this->_platform));
        $this->createView($view);
    }
1078083
public function viewContentsInitialized(View $view) {
		$this->cacheStore->store($view->getName(), $this->viewCacheControl->getCharacteristics(), 
				$view->toCacheData());
	}
788096
public function view($view, $data = [])
    {
        $viewPath = self::$instance->app->findView($view);
        echo self::$instance->renderView($viewPath, $data);
    }
632314
protected function render($view,$data)
	{
		$app=Yii::app();
		$isAjax=$app->getRequest()->getIsAjaxRequest();
		$isFlash=$app->getRequest()->getIsFlashRequest();

		if($this->showInFireBug)
		{
			// do not output anything for ajax and/or flash requests if needed
			if($isAjax && $this->ignoreAjaxInFireBug || $isFlash && $this->ignoreFlashInFireBug)
				return;
			$view.='-firebug';
			if(($userAgent=$app->getRequest()->getUserAgent())!==null && preg_match('/msie [5-9]/i',$userAgent))
			{
				echo '<script type="text/javascript">';
				echo file_get_contents(dirname(__FILE__).'/../vendors/console-normalizer/normalizeconsole.min.js');
				echo "</script>\n";
			}
		}
		elseif(!($app instanceof CWebApplication) || $isAjax || $isFlash)
			return;

		$viewFile=YII_PATH.DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.$view.'.php';
		include($app->findLocalizedFile($viewFile,'en'));
	}
202640
protected function _initView ()
    {
        // Create default view model, to be used in all templates and layouts
        $this->appView  = new \Zend\View\Model\ViewModel();

        // Convenience access variables
        $this->_appView = $this->appView;
        $this->view     = $this->appView;
        $this->_view    = $this->appView;
    }
1058540
public function compose(View $view)
    {
        $view->withAboutApp(Markdown::convertToHtml($this->config->get('setting.app_about')));
        $view->withAppAnalytics($this->config->get('setting.app_analytics'));
        $view->withAppAnalyticsGoSquared($this->config->get('setting.app_analytics_gs'));
        $view->withAppAnalyticsPiwikUrl($this->config->get('setting.app_analytics_piwik_url'));
        $view->withAppAnalyticsPiwikSiteId($this->config->get('setting.app_analytics_piwik_site_id'));
        $view->withAppBanner($this->config->get('setting.app_banner'));
        $view->withAppBannerStyleFullWidth($this->config->get('setting.style_fullwidth_header'));
        $view->withAppBannerType($this->config->get('setting.app_banner_type'));
        $view->withAppDomain($this->config->get('setting.app_domain'));
        $view->withAppGraphs($this->config->get('setting.display_graphs'));
        $view->withAppLocale($this->config->get('setting.app_locale'));
        $view->withAppStylesheet($this->config->get('setting.stylesheet'));
        $view->withAppUrl($this->config->get('app.url'));
        $view->withAppHeader($this->config->get('setting.header'));
        $view->withAppFooter($this->config->get('setting.footer'));
        $view->withAppName($this->config->get('setting.app_name'));
        $view->withShowSupport($this->config->get('setting.show_support'));
        $view->withAutomaticLocalization($this->config->get('setting.automatic_localization'));
        $view->withEnableExternalDependencies($this->config->get('setting.enable_external_dependencies'));
        $view->withShowTimezone($this->config->get('setting.show_timezone'));
        $view->withAppRefreshRate($this->config->get('setting.app_refresh_rate'));
        $view->withTimezone($this->dates->getTimezone());
        $view->withSiteTitle($this->config->get('setting.app_name'));
        $view->withFontSubset($this->config->get('langs.'.$this->config->get('app.locale').'.subset', 'latin'));
        $view->withOnlyDisruptedDays($this->config->get('setting.only_disrupted_days'));
        $view->withDashboardLink($this->config->get('setting.dashboard_login_link'));
        $view->withEnableSubscribers($this->config->get('setting.enable_subscribers'));
    }
865423
public function init()
    {
        $view = Yii::$app->getView();
        if ($this->popupMode) {
            AuthChoiceAsset::register($view);
            if (empty($this->clientOptions)) {
                $options = '';
            } else {
                $options = Json::htmlEncode($this->clientOptions);
            }
            $view->registerJs("jQuery('#" . $this->getId() . "').authchoice({$options});");
        } else {
            AuthChoiceStyleAsset::register($view);
        }
        $this->options['id'] = $this->getId();
        echo Html::beginTag('div', $this->options);
    }