yii\base\Widget::getView PHP Method

getView() public method

The Widget::render and Widget::renderFile methods will use this view object to implement the actual view rendering. If not set, it will default to the "view" application component.
public getView ( ) : View
return yii\web\View the view object that can be used to render views or view files.
    public function getView()
    {
        if ($this->_view === null) {
            $this->_view = Yii::$app->getView();
        }
        return $this->_view;
    }