src/Leevel/View/Phpui.php
public function display(string $file, array $vars = [], ?string $ext = null, bool $display = true)
    {
        // 加载视图文件
        $file = $this->parseDisplayFile($file, $ext);

        // 变量赋值
        if ($vars) {
            $this->setVar($vars);
        }

        if (is_array($this->vars) && !empty($this->vars)) {
            extract($this->vars, EXTR_PREFIX_SAME, 'q_');
        }

        // 返回类型
        if (false === $display) {
            ob_start();
            include $file;
            $result = ob_get_contents();
            ob_end_clean();

            return $result;
        }

        include $file;
    }
public function display(string $file, array $vars = [], ?string $ext = null, bool $display = true)
    {
        // 加载视图文件
        $file = $this->parseDisplayFile($file, $ext);

        // 变量赋值
        if ($vars) {
            $this->setVar($vars);
        }

        if (is_array($this->vars) && !empty($this->vars)) {
            extract($this->vars, EXTR_PREFIX_SAME, 'q_');
        }

        // 返回类型
        if (false === $display) {
            ob_start();
            include $file;
            $result = ob_get_contents();
            ob_end_clean();

            return $result;
        }

        include $file;
    }
加载视图文件.

@param string $file    视图文件地址
@param array  $vars
@param string $ext     后缀
@param bool   $display 是否显示

@return string|void