Display a php file page.
@param string $file
@param array $vars
191601
public function display($file, $vars = [])
    {
        if ((DIRECTORY_SEPARATOR !== $file[0]) && (':' !== $file[1])) { // get path if not full path was sent
            $moduleFolder = $this->request->getModulePath();
            $controllerFolder = $this->request->getController();
            $viewsFolder = str_replace(['{APP_ROOT}', '{MODULE_FOLDER}', '{CONTROLLER}', '{LIBS_FOLDER}', '{DIRECTORY_SEPARATOR}'], [
                APP_ROOT, $moduleFolder, $controllerFolder, LIBS_FOLDER, DIRECTORY_SEPARATOR
            ], $this->viewsFolder);
            $file = $viewsFolder . DIRECTORY_SEPARATOR . $file . '.php';
        }
        foreach ($this->_displayVars as $k => $v) {
            $$k = $v;
        }
        foreach ($vars as $k => $v) {
            $$k = $v;
        }
        require $file;
    }
1131971
public static function script($file, array $attributes = null)
    {
        $attributes['src'] = $file;
        $attributes['type'] = 'text/javascript';

        return (new Script($attributes))->render();
    }
459049
public function parsePhp(array $vars = [])
    {
        if(count($vars)) {
            $this->loadVars($vars);
        }

        extract($this->vars);

        /*
         * Buffer the output
         *
         * We buffer the output for two reasons:
         * 1. Speed. You get a significant speed boost.
         * 2. So that the final rendered template can be post-processed by
         *  the output class. Why do we need post processing? For one thing,
         *  in order to show the elapsed page load time. Unless we can
         *  intercept the content right before it's sent to the browser and
         *  then stop the timer it won't be accurate.
         */
        ob_start();

        echo eval('?>' . str_replace([';?>', ')?>', ');?>'], ['; ?>', '); ?>', '); ?>'], $this->sourceString));

        $output = ob_get_contents();
        @ob_end_clean();

        $lastError = error_get_last();

        if (is_array($lastError)) {
            $this->errorFilePath = $this->getSourceFilePath();
        }

        return $output;
    }
244427
public function _include($file, $__vars = null, $layout_block = false, $return = false)
    {
        if (is_array($this->vars)) {
            extract($this->vars);
        }

        if (is_array($__vars)) {
            extract($__vars);
        }

        if ($layout_block) {
            ob_start();
            include APP_PATH . '/views/' . $this->__filename($file);
            $content = ob_get_clean();
            //echo $content;print_r($this->_layout);exit;

            if ($this->_layout) {
                foreach ($this->_layout as $k => $v) {
                    $content = str_replace("<!--{layout_block_{$k}}-->", $v, $content);
                }
            }

            // 是否返回
            if ($return) {
                return $content;
            } else {
                echo $content;
            }
        } elseif ($return) {
            ob_start();
            include APP_PATH . '/views/' . $this->__filename($file);
            return ob_get_clean();
        } else {
            include APP_PATH . '/views/' . $this->__filename($file);
        }
    }
974777
public function display($input, array $vars = [], $filename = null)
    {
        if ($this->stringCanBeLoadedAsFile($input)) {
            echo $this->renderFile($input, $vars);

            return;
        }

        $this->displayString($input, $vars, $filename);
    }
1258586
private function loadFile ($file)
	{
		if (!isset ($this->files[$file]))
		{
			$filename = $this->folder . $file . '.php';

			// First load these
			if (file_exists ($filename))
			{
				$this->files[$file] = include ($filename);
			}

			// Now overload with environment values
			if (isset ($this->environment))
			{
				$filename = $this->folder . $this->environment . '/' . $file . '.php';
				if (file_exists ($filename))
				{
					$this->merge ($file, include ($filename));
				}
			}

		}
	}
569464
public function loadHtmlFile($file)
    {
        $this->saveLocale();

        if (!$this->protocol && !$this->baseHost && !$this->basePath) {
            list($this->protocol, $this->baseHost, $this->basePath) = Helpers::explode_url($file);
        }
        $protocol = strtolower($this->protocol);

        if ( !in_array($protocol, $this->allowedProtocols) ) {
            throw new Exception("Permission denied on $file. The communication protocol is not supported.");
        }

        if (!$this->options->isRemoteEnabled() && ($protocol != "" && $protocol !== "file://")) {
            throw new Exception("Remote file requested, but remote file download is disabled.");
        }

        if ($protocol == "" || $protocol === "file://") {
            $realfile = realpath($file);

            $chroot = realpath($this->options->getChroot());
            if ($chroot && strpos($realfile, $chroot) !== 0) {
                throw new Exception("Permission denied on $file. The file could not be found under the directory specified by Options::chroot.");
            }

            $ext = strtolower(pathinfo($realfile, PATHINFO_EXTENSION));
            if (!in_array($ext, $this->allowedLocalFileExtensions)) {
                throw new Exception("Permission denied on $file. This file extension is forbidden");
            }

            if (!$realfile) {
                throw new Exception("File '$file' not found.");
            }

            $file = $realfile;
        }

        list($contents, $http_response_header) = Helpers::getFileContent($file, $this->httpContext);
        $encoding = 'UTF-8';

        // See http://the-stickman.com/web-development/php/getting-http-response-headers-when-using-file_get_contents/
        if (isset($http_response_header)) {
            foreach ($http_response_header as $_header) {
                if (preg_match("@Content-Type:\s*[\w/]+;\s*?charset=([^\s]+)@i", $_header, $matches)) {
                    $encoding = strtoupper($matches[1]);
                    break;
                }
            }
        }

        $this->restoreLocale();

        $this->loadHtml($contents, $encoding);
    }
383031
protected function load_file($file)
	{
		$contents = $this->parse_vars(file_get_contents($file));
		return parse_ini_string($contents, true);
	}
1316704
public function display($content, $vars = [], $config = [])
    {
        if ($vars) {
            $this->data = $vars;
        }

        if ($config) {
            $this->config($config);
        }

        $cacheFile = $this->config['cache_path'] . $this->config['cache_prefix'] . md5($content) . '.' . ltrim($this->config['cache_suffix'], '.');

        if (!$this->checkCache($cacheFile)) {
            // 缓存无效 模板编译
            $this->compiler($content, $cacheFile);
        }

        // 读取编译存储
        $this->storage->read($cacheFile, $this->data);
    }
1078976
public function show($file, $data)
    {
        $this->setTemplate($file);
        //
        $this->assign($data);
        //
        $this->store($this->compile());
        //
        $this->display();
    }
971246
protected function loadTemplate( $path, array $vars = [] ) {

		$search = '/templates/epub201/';
		$replace = '/templates/epub3/';

		$pos = strpos( $path, $search );
		if ( false !== $pos ) {
			$new_path = substr_replace( $path, $replace, $pos, strlen( $search ) );
			if ( file_exists( $new_path ) ) {
				$path = $new_path;
			}
		}

		return parent::loadTemplate( $path, $vars );
	}
715549
protected function render($template, array $vars = [])
    {
        $pluginTemplateFolder = $this->plugin->getTemplateFolder();
        if (!empty($pluginTemplateFolder)) {
            $loader = new \Twig_Loader_Filesystem($pluginTemplateFolder);
            $this->app['twig']->getLoader()->addLoader($loader);
        }

        $defaults = [
            'layout' => [
                'title' => preg_replace('/\\.[^.\\s]{3,4}$/', '', $template)
            ]
        ];
        $vars = array_replace_recursive($defaults, $vars);

        return $this->app['twig']->render($template, $vars);
    }
1181713
public function _include($file, $__vars = null, $layout_block = false, $return = false)
    {
        if (is_array($this->vars)) {
            extract($this->vars);
        }

        if (is_array($__vars)) {
            extract($__vars);
        }

        /* support MultiView */
        $file = $this->__filename($file);
        $tpl  = Config::get('tpl_switch');

        if (!file_exists(APP_PATH . '/views/' . $tpl . '/' . $file)) {
            if ($tpl !== 'default') {
                if (file_exists(APP_PATH . '/views/default/' . $file)) {
                    $tpl = 'default';
                } else {
                    throw new ephpException("视图{$tpl}/{$file}不存在，公共视图default/{$file}也不存在,请保证其一存在!");
                }
            } else {
                throw new ephpException("主题视图{$tpl}/{$file}不存在。");
            }
        }

        $file = $tpl . '/' . $file;
        /* support MultiView */

        if ($layout_block) {
            $tpl = Config::get('tpl_switch');

            ob_start();
            include APP_PATH . '/views/' . $file;
            $content = ob_get_clean();
            //echo $content;print_r($this->_layout);exit;

            if ($this->_layout) {
                foreach ($this->_layout as $k => $v) {
                    $content = str_replace("<!--{layout_block_{$k}}-->", $v, $content);
                }
            }

            //是否返回
            if ($return) {
                return $content;
            } else {
                echo $content;
            }
        } elseif ($return) {
            ob_start();
            include APP_PATH . '/views/' . $file;
            return ob_get_clean();
        } else {
            include APP_PATH . '/views/' . $file;
        }
    }
341020
function setTemplateFile($file){
		$this->_template->setTemplateFile(ROOT . DS . 'application' . DS . 'views' . DS . $file);
		
	}
1215169
protected function render($filePath, $variables = array()) {
        foreach ($this->_vars as $k => $n) {
            $$k = $n;
        }
        foreach ($variables as $k => $n) {
            $$k = $n;
        }
        require $filePath;
    }
381105
protected function setServicesFile($path, $template, array $vars) {
    $this->addServicesFile()
      ->path($path)
      ->template($template)
      ->vars($vars);
  }
632203
private function setupCurlOptsFromFile(string $file = null)
    {
        $file = is_null($file) ? getenv("HOME") . "/.config/jaggedsoft/php-binance-api.json" : $file;

        if (count($this->curlOpts) > 0) {
            return;
        }
        if (file_exists($file) === false) {
            echo "Unable to load config from: " . $file . PHP_EOL;
            echo "No curl options will be set" . PHP_EOL;
            return;
        }
        $contents = json_decode(file_get_contents($file), true);
        $this->curlOpts = isset($contents['curlOpts']) && is_array($contents['curlOpts']) ? $contents['curlOpts'] : [];
    }