yii\web\ErrorHandler::renderFile PHP Method

renderFile() public method

Renders a view file as a PHP script.
public renderFile ( string $_file_, array $_params_ ) : string
$_file_ string the view file.
$_params_ array the parameters (name-value pairs) that will be extracted and made available in the view file.
return string the rendering result
    public function renderFile($_file_, $_params_)
    {
        $_params_['handler'] = $this;
        if ($this->exception instanceof ErrorException || !Yii::$app->has('view')) {
            ob_start();
            ob_implicit_flush(false);
            extract($_params_, EXTR_OVERWRITE);
            require Yii::getAlias($_file_);
            return ob_get_clean();
        } else {
            return Yii::$app->getView()->renderFile($_file_, $_params_, $this);
        }
    }