source/Core/WidgetControl.php
protected function _initializeViewObject($class, $function, $parameters = null, $viewsChain = null)
    {
        $config = \OxidEsales\Eshop\Core\Registry::getConfig();
        $activeViewsIds = $config->getActiveViewsIds();
        $activeViewsIds = array_map("strtolower", $activeViewsIds);
        $classKey = Registry::getControllerClassNameResolver()->getIdByClassName($class);
        $classKey = !is_null($classKey) ? $classKey : $class; //fallback

        // if exists views chain, initializing these view at first
        if (is_array($viewsChain) && !empty($viewsChain)) {
            foreach ($viewsChain as $parentClassKey) {
                $parentClass = Registry::getControllerClassNameResolver()->getClassNameById($parentClassKey);

                if ($parentClassKey != $classKey && !in_array(strtolower($parentClassKey), $activeViewsIds) && $parentClass) {
                    // creating parent view object
                    $viewObject = oxNew($parentClass);
                    if ('oxubase' != strtolower($parentClassKey)) {
                        $viewObject->setClassKey($parentClassKey);
                    }
                    $config->setActiveView($viewObject);
                    $this->parentsAdded[] = $parentClassKey;
                }
            }
        }

        $widgetViewObject = parent::_initializeViewObject($class, $function, $parameters, null);

        if (!is_a($widgetViewObject, WidgetController::class)) {
            /** @var ObjectException $exception */
            $exception = oxNew(ObjectException::class, get_class($widgetViewObject) . ' is not an instance of ' . WidgetController::class);
            throw $exception;
        }

        // Set template name for current widget.
        if (!empty($parameters['oxwtemplate'])) {
            $widgetViewObject->setTemplateName($parameters['oxwtemplate']);
        }

        return $widgetViewObject;
    }
protected function _initializeViewObject($class, $function, $parameters = null, $viewsChain = null)
    {
        $config = \OxidEsales\Eshop\Core\Registry::getConfig();
        $activeViewsIds = $config->getActiveViewsIds();
        $activeViewsIds = array_map("strtolower", $activeViewsIds);
        $classKey = Registry::getControllerClassNameResolver()->getIdByClassName($class);
        $classKey = !is_null($classKey) ? $classKey : $class; //fallback

        // if exists views chain, initializing these view at first
        if (is_array($viewsChain) && !empty($viewsChain)) {
            foreach ($viewsChain as $parentClassKey) {
                $parentClass = Registry::getControllerClassNameResolver()->getClassNameById($parentClassKey);

                if ($parentClassKey != $classKey && !in_array(strtolower($parentClassKey), $activeViewsIds) && $parentClass) {
                    // creating parent view object
                    $viewObject = oxNew($parentClass);
                    if ('oxubase' != strtolower($parentClassKey)) {
                        $viewObject->setClassKey($parentClassKey);
                    }
                    $config->setActiveView($viewObject);
                    $this->parentsAdded[] = $parentClassKey;
                }
            }
        }

        $widgetViewObject = parent::_initializeViewObject($class, $function, $parameters, null);

        if (!is_a($widgetViewObject, WidgetController::class)) {
            /** @var ObjectException $exception */
            $exception = oxNew(ObjectException::class, get_class($widgetViewObject) . ' is not an instance of ' . WidgetController::class);
            throw $exception;
        }

        // Set template name for current widget.
        if (!empty($parameters['oxwtemplate'])) {
            $widgetViewObject->setTemplateName($parameters['oxwtemplate']);
        }

        return $widgetViewObject;
    }
protected function _initializeViewObject ( $ class , $ function , $ parameters = null , $ viewsChain = null ) { $ config = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ activeViewsIds = $ config -> getActiveViewsIds ( ) ; $ activeViewsIds = array_map ( "strtolower" , $ activeViewsIds ) ; $ classKey = Registry :: getControllerClassNameResolver ( ) -> getIdByClassName ( $ class ) ; $ classKey = ! is_null ( $ classKey ) ? $ classKey : $ class ; //fallback // if exists views chain, initializing these view at first if ( is_array ( $ viewsChain ) && ! empty ( $ viewsChain ) ) { foreach ( $ viewsChain as $ parentClassKey ) { $ parentClass = Registry :: getControllerClassNameResolver ( ) -> getClassNameById ( $ parentClassKey ) ; if ( $ parentClassKey != $ classKey && ! in_array ( strtolower ( $ parentClassKey ) , $ activeViewsIds ) && $ parentClass ) { // creating parent view object $ viewObject = oxNew ( $ parentClass ) ; if ( 'oxubase' != strtolower ( $ parentClassKey ) ) { $ viewObject -> setClassKey ( $ parentClassKey ) ; } $ config -> setActiveView ( $ viewObject ) ; $ this -> parentsAdded [ ] = $ parentClassKey ; } } } $ widgetViewObject = parent :: _initializeViewObject ( $ class , $ function , $ parameters , null ) ; if ( ! is_a ( $ widgetViewObject , WidgetController :: class ) ) { /** @var ObjectException $exception */ $ exception = oxNew ( ObjectException :: class , get_class ( $ widgetViewObject ) . ' is not an instance of ' . WidgetController :: class ) ; throw $ exception ; } // Set template name for current widget. if ( ! empty ( $ parameters [ 'oxwtemplate' ] ) ) { $ widgetViewObject -> setTemplateName ( $ parameters [ 'oxwtemplate' ] ) ; } return $ widgetViewObject ; }
Initialize and return widget view object.

@param string $class      View class
@param string $function   Function name
@param array  $parameters Parameters array
@param array  $viewsChain Array of views keys that should be initialized as well

@throws ObjectException

@return \OxidEsales\Eshop\Core\Controller\BaseController Current active view
Initialize and return widget view object .