Registers this asset bundle with a view.
@param string $alias
@param yii\web\View $view the view to be registered with
@return static|null the registered asset bundle instance
357959
public static function registerAsset($alias, $view)
    {
        $module = static::instance();
        if (!empty($module)) {
            $class = $module->getAssetClassname($alias);
            return $class::register($view);
        }
    }
904647
public function setView($view)
    {
        $view   = parent::setView($view);
        $format = $this->getRequest()->getFormat();

        if ($view instanceof KObjectIdentifier && $view->getPackage() != 'activities' && $format  !== 'html')
        {
            $manager = $this->getObject('manager');

            // Set the view identifier as an alias of the component view.
            if (!$manager->getClass($view, false))
            {
                $identifier = $view->toArray();
                $identifier['package'] = 'activities';
                unset($identifier['domain']);

                $manager->registerAlias($identifier, $view);
            }
        }

        return $view;
    }
946954
public function registerActionAlias($alias, $action)
    {
        $alias = strtolower($alias);

        if (! in_array($alias, $this->getActions()))  {
            $this->_action_map[$alias] = $action;
        }

        //Force reload of the actions
        $this->_actions = array_unique(array_merge($this->_actions, array_keys($this->_action_map)));

        return $this;
    }
337972
public function getView(View $view)
    {
        if (($configHash = $this->matcherFactory->match($view)) === null) {
            return null;
        }

        // We can set the collection directly to the view, no need to go through DTO
        $view->addParameters([
            ContentView::QUERY_DEFINITION_COLLECTION_NAME => $this->getQueryDefinitionCollection($configHash, $view),
        ]);

        // Return DTO so that Configurator can set the data back to the $view
        return $this->getDTO($configHash);
    }
1008951
public function registerAssetFiles($view)
    {
        $language = Yii::$app->language;
        if (file_exists($this->sourcePath . "/$language.js") !== false) {
            $this->js = [
                "$language.js"
            ];
        }

        parent::registerAssetFiles($view);
    }
794949
public function addView(View $view)
    {
        $name = $view->getName();
        $path = $view->getPath();

        if (!is_object($path)) {
            if ($path) {
                $path = ltrim(str_replace(base_path(), '', realpath($path)), '/');
            }

            if (substr($path, -10) == '.blade.php') {
                $type = 'blade';
            } else {
                $type = pathinfo($path, PATHINFO_EXTENSION);
            }
        } else {
            $type = get_class($view);
            $path = '';
        }

        if (!$this->collect_data) {
            $params = array_keys($view->getData());
        } else {
            $data = [];
            foreach ($view->getData() as $key => $value) {
                $data[$key] = $this->exporter->exportValue($value);
            }
            $params = $data;
        }

        $this->templates[] = [
            'name'        => $path ? sprintf('%s (%s)', $name, $path) : $name,
            'param_count' => count($params),
            'params'      => $params,
            'type'        => $type,
        ];
    }
997950
public function composeWithAllRouteNames(View $view)
    {
        $routes = $this->getAllRouteNames();

        foreach ($routes as $action => $routeName) {
            $view->with("{$action}Route", $routeName);
        }
    }
872646
protected function registerScripts(\yii\web\View $view){
        if ($this->clientOptions !== false) {
            $options = empty($this->clientOptions) ? '' : Json::encode($this->clientOptions);
            $js = "jQuery('#{$this->id}').fancybox($options);";
            $view->registerJs($js , View::POS_READY);
        }
    }
279241
public function setView($view)
    {
        parent::setView($view);

        if (!$this->_view instanceof LibBaseViewAbstract) {
            $view = AnInflector::isPlural($view) ? 'comments' : 'comment';
            $defaults[] = 'ComBaseView'.ucfirst($view).ucfirst($this->_view->name);
            register_default(array(
                'identifier' => $this->_view,
                'default' => $defaults, ));
        }

        return $this;
    }
789246
public function setView( MW_View_Interface $view )
	{
		$this->_view = $view;
		$this->_client->setView( $view );
	}
523053
private static function init_view()
    {
        static::$container->add_singleton(
            View::class,
            function (Container $hodl) {
                return $hodl->resolve(View::class);
            }
        );

        static::$container->alias(View::class, 'view');
    }
243393
protected static function registerView()
    {
        if (self::$_view === null) {
            Yii::$app->view->on(View::EVENT_BEGIN_BODY, function ($event) {
                echo '<script type="application/ld+json">' . Json::encode($event->sender->params) . '</script>';
            });
                    
            self::$_view = true;
        }
    }
221714
public function registerAssetFiles($view)
    {
        parent::registerAssetFiles($view);



        $localeEncoded = Json::encode(Yii::$app->language);
        $js = <<<js
var polyglot = new Polyglot({locale: $localeEncoded});
js;

        Yii::$app->controller->getView()->registerJs($js, \yii\web\View::POS_HEAD);


    }
167271
public void registerView(final String type, final Pair<View, View> view) {
        registeredViews.put(type, view);
    }
1341273
public function compose(View $view)
    {
        $user = Auth::user();

        $view->withRequest($this->request)
            ->withNavigationSections($this->laramanagerNavigationSection->with('links')->get())
            ->withUser($user);
    }
1367522
public function compose(View $view)
    {
        /**
         * @var  \Carbon\Carbon                  $start
         * @var  \Carbon\Carbon                  $end
         * @var  \Illuminate\Support\Collection  $range
         */
        extract(DateRange::getCurrentMonthDaysRange());

        $view->with('authenticatedVisitorsRatio', $this->getAuthenticatedVisitorsRatio(
            $this->getVisitorsFilteredByDateRange($start, $end)
        ));
    }
377622
public function compose(View $view)
    {
        $userGroupRepository = app(UserGroupInterface::class);
        $userGroupOptions = $userGroupRepository->all()->pluck('name', 'id');
        $view->with('userGroupOptions', $userGroupOptions);
    }