Give ability of configure view to the module class.

@return \yii\base\View|\yii\web\View
556811
public function getView()
    {
        $module = \Yii::$app->controller->module;

        if (method_exists($module, 'getView')) {
            return $module->getView();
        }

        return parent::getView();
    }
388243
public function getViewHelperConfig()
    {
        return [
            'factories' => [
                View\Helper\Params::class => View\Helper\Factory\ParamsFactory::class,
                View\Helper\Config::class => View\Helper\Factory\ConfigFactory::class,
                View\Helper\Env::class => View\Helper\Factory\EnvFactory::class,
                View\Helper\CdnVersion::class => View\Helper\Factory\EnvFactory::class,
                View\Helper\FormLocalMessage::class => InvokableFactory::class,
                //\Zend\Form\View\Helper\FormElementErrors::class => View\Helper\Factory\FormElementErrorsFactory::class,
            ],
            'aliases' => [
                'helperParams' => View\Helper\Params::class,
                'helperConfig' => View\Helper\Config::class,
                'helperEnv' => View\Helper\Env::class,
                'helperCdnVersion' => View\Helper\CdnVersion::class,
                'formLocalMessage' => View\Helper\FormLocalMessage::class,
                'helperFormLocalMessage' => View\Helper\FormLocalMessage::class,
            ],
        ];
    }
636706
private function view()
    {
        if (isset(static::$view)) {
            return static::$view;
        }

        $classNamespace = $this->getModuleName();
        $className = $this->getComponentName();

        return "{$classNamespace}::blocks.{$className}";
    }
157650
protected function GetModuleConfiguration()
    {
        if (is_null($this->oModuleConfiguration)) {
            $oModuleConfiguration = TdbPkgShopArticleReviewModuleShopArticleReviewConfiguration::GetNewInstance();
            if ($oModuleConfiguration->LoadFromField('cms_tpl_module_instance_id', $this->instanceID)) {
            }
            $this->oModuleConfiguration = $oModuleConfiguration;
        }

        return $this->oModuleConfiguration;
    }
721452
public function getView()
    {
        if ($this->_view === null) {
            $this->_view = Yii::createObject(PhpBlockView::class);
        }
        
        return $this->_view;
    }
738233
public function create()
    {
        $genericPermissions = $this->permissions->generic();
        $modulePermissions = $this->permissions->module();
        $groupPermissions = array();

        return View::make(Config::get('cpanel::views.groups_create'))
            ->with('genericPermissions',$genericPermissions)
            ->with('modulePermissions',$modulePermissions)
            ->with('groupPermissions',$groupPermissions);
    }
130953
public function getViewBuilder()
    {
        if (null === $this->viewBuilder) {
            $this->viewBuilder = new View\ViewBuilder();
            $this->viewBuilder->setEditor($this);
        }

        return $this->viewBuilder;
    }
665345
public function getViewHelperConfig()
    {
        $serviceLocator = $this->serviceLocator;

        return array(
            'invokables'    => array(
                'formColumnsPercentages' => 'Grid\Paragraph\Form\View\Helper\FormColumnsPercentages',
            ),
            'factories'     => array(
                'metaContent' => function ( $sm ) use ( $serviceLocator ) {
                    return new View\Helper\MetaContent(
                        $serviceLocator->get(
                            'Grid\Paragraph\Model\Paragraph\MiddleLayoutModel'
                        )
                    );
                },
            ),
        );
    }
235913
public function actionSelectFile()
    {
        //$this->layout = '@skeeks/cms/modules/admin/views/layouts/main.php';
        \Yii::$app->cmsToolbar->enabled = 0;

        $model = null;
        $className = \Yii::$app->request->get('className');
        $pk = \Yii::$app->request->get('pk');

        if ($className && $pk) {
            if ($model = $className::findOne($pk)) {

            }
        }


        return $this->render($this->action->id, [
            'model' => $model
        ]);
    }
1250629
protected function bootstrap()
    {
        parent::bootstrap();

        $this->viewPath = __DIR__ . '/views';

        if (!isset($this->i18n->translations['colibri'])) {
            $this->i18n->translations['colibri'] = [
                'class' => 'yii\i18n\PhpMessageSource',
                'basePath' => __DIR__ . '/messages'
            ];
        }

        // Look in @app/messages directory for all categories
        if (!isset($this->i18n->translations['*'])) {
            $this->i18n->translations['*'] = [
                'class' => 'yii\i18n\PhpMessageSource',
                'basePath' => '@app/messages'
            ];
        }

        if (!file_exists($this->basePath . '/.env')) {
            // Remove query part
            $url = preg_replace('/\?.*$/', '', $this->getRequest()->url);

            if ($url != '/install') {
                $this->getResponse()->redirect(['/install']);
            }

            /* Now the route is install.
             *
             * Set the minimal layout to avoid potential db queries in the main layout
             */
            $this->layout = 'minimal';
        }
    }
354018
public function init()
    {
        // if set use CKEditor configurations from settings module else use default configuration.
        $json = \Yii::$app->settings->get('ckeditor.config', 'widgets');
        $ckeditorConfiguration = isset($json->scalar) ? $json->scalar : "{}";
        $script = "window.CKCONFIG = {$ckeditorConfiguration};";
        \Yii::$app->view->registerJs($script, \yii\web\View::POS_HEAD);


        if ($this->name === null && !$this->hasModel() && $this->selector === null) {
            throw new InvalidConfigException("Either 'name', or 'model' and 'attribute' properties must be specified.");
        }

        if (null === $this->schema) {
            throw new InvalidConfigException("You must specify 'schema' property.");
        }

        if ($this->hasModel() && !isset($this->options['id'])) {
            $this->options['id'] = Html::getInputId($this->model, $this->attribute);
        }

        if ($this->hasModel()) {
            $this->name  = empty($this->options['name']) ? Html::getInputName($this->model, $this->attribute) : $this->options['name'];
            $this->value = Html::getAttributeValue($this->model, $this->attribute);
        }

        if (!isset($this->containerOptions['id'])) {
            $this->containerOptions['id'] = ($this->hasModel() ? Html::getInputId($this->model, $this->attribute) : $this->getId()) . '-container';
        }

        if ($this->inputId === null) {
            $this->inputId = $this->options['id'];
        } else {
            $this->_renderInput = false;
        }

        parent::init();
        JsonEditorAsset::register($this->getView());
        JsonEditorPluginsAsset::register($this->getView());
    }
1178785
public function getViewHelperConfig()
    {
        return array(
            'factories' => array(
                'calendar' => function ($vhm) {
                    $helper = new \BmCalendar\View\Helper\Calendar();

                    $helper->setRenderer(new \BmCalendar\Renderer\HtmlCalendar());

                    return $helper;
                }
            ),
        );
    }
1162136
protected function getModuleConfig(string $module, string $view, array $options = []): ModuleConfig
    {
        $mc = new ModuleConfig(ConfigType::VIEW(), $module, $view, ['cacheSkip' => true]);

        $schema = $mc->createSchema(['lint' => true]);
        $schema->setCallback(function (array $schema) use ($module) {
            //Add fields from migration file
            $schema = $this->addFieldsToSchema($schema, $module);
            //Add relation fields
            $schema = $this->addRelationToSchema($schema, $module);

            return $schema;
        });

        $mc->setParser(new Parser($schema, ['lint' => true, 'validate' => true]));

        return $mc;
    }
1086395
public function getView() {
		
		try {
			
			if ($this->view) {
				
				$file = $this->modulePath .'/view'. ucfirst($this->view) .'.php';
				
				if (!file_exists($file)) {
					if ($this->app->currentUser->areKeysPopulated()) {
						throw new \Exception('View file '. $file .' has not been found');
					} else {
						die('Access denied');
					}
				}

				include_once($file);

				$viewName = ucfirst($this->name) .'View'. ucfirst($this->view);
				
				if (!class_exists($viewName)) {
					throw new \Exception('Class ' . $viewName . ' was not found in file ' . $file);
				}
				
				return new $viewName();
				
			} else {
				
				throw new \Exception('No view file has been set');
				
			}
		
		} catch (\Exception $e) {
			
			// set the error in the log
			$this->app->logError($e->getMessage());
			
			// get a fall-back referer or default and redirect the user
			$url = !isset($_SERVER['REFERER']) ? $_SERVER['REFERER'] : BASE_HREF;
			$this->redirect($url, TRUE);
			
		}
		
		return NULL;
		
	}
448783
public function getConfiguration()
    {
        if (!$this->_configuration) {

            //If model is using
            if ($this->modelClass) {

                $this->_configuration = $this->_keyStorage->get($this->getKey()) ?: [];
                $modelClass = $this->modelClass;
                if (!$this->_configuration || !($this->_configuration instanceof $modelClass)) {
                    //Initialize new model. Default values must be set in model (init method)
                    $this->_configuration = Yii::createObject($modelClass, $this->modelConfig);
                }

                //Default values from 'attributes'
                if (is_array($this->attributes)) {
                    foreach ($this->attributes as $key => $default) {
                        if ($this->_configuration->{$key} === null) {
                            $this->_configuration->{$key} = $default;
                        }
                    }
                }

            } else {

                //Array configuration
                $dbConfig = $this->_keyStorage->get($this->getKey()) ?: [];

                if (is_array($this->attributes)) {
                    //Needs to filter
                    $config = [];
                    foreach ($this->attributes as $key => $default) {
                        $config[$key] = (isset($dbConfig[$key]) && $dbConfig[$key] !== null) ? $dbConfig[$key] : $default;
                    }
                    $this->_configuration = $config;
                } else {
                    $this->_configuration = $dbConfig;
                }

            }
        }
        return $this->_configuration;
    }
666054
public function getViewEngine()
    {
        if($this->app->exists(ViewEngineInterface::class)) {
            return $this->app->get(ViewEngineInterface::class);
        }
        $view = View::forge($this->web->view_dir);
        $this->app->set(ViewEngineInterface::class, $view, true);
        return $view;
    }
1072892
private static function view()
    {
        $files = ['View'];
        $folder = static::$root.'MVC/View'.'/';

        self::call($files, $folder);

        $files = ['Template', 'Views'];
        $folder = static::$root.'MVC/View/Libs'.'/';

        self::call($files, $folder);

        $files = ['ViewNotFoundException'];
        $folder = static::$root.'MVC/View/Exceptions'.'/';

        self::call($files, $folder);
    }