Get the evaluated contents of the view at the given path.

@param  string $__path
@param  array  $__data
@return string
430458
protected function evaluatePath($__path, $__data)
    {
        $obLevel = ob_get_level();

        // We'll evaluate the contents of the view inside a try/catch block so we can
        // flush out any stray output that might get out before an error occurs or
        // an exception is thrown. This prevents any partial views from leaking.
        $renderer = include($__path);

        $results = $renderer($__data);

        return ltrim($results);
    }
164684
public function getView($name, $data = [])
    {
        $view = 'missing-page';

        if (view()->exists('page::' . $name)) {
            $view = $name;
        }

        return view('page::' . $view, $data);
    }
303535
public static function get($path, $data = [])
	{
		ob_start();

		extract($data);

		try {
			$basePath = static::getInstance()->basePath;

			if ($basePath !== null) {
				if (mb_substr($path, 0, 1) === static::DIRECTORY_SEPARATOR) {
					$path = mb_substr($path, 1);
				}

				if (mb_substr($basePath, -1) === static::DIRECTORY_SEPARATOR) {
					$basePath = mb_substr($basePath, 0, -1);
				}

				$path = $basePath . static::DIRECTORY_SEPARATOR . $path;
			}

			include $path;
		} catch (\Exception $e) {
			ob_get_clean();
			throw $e;
		}

		return ob_get_clean();
	}
1091586
public function get_data($path=NULL) {
		$myIndexList = array();
		$path = $this->fix_path($path);
		
		if(is_null($path) || (strlen($path) < 1)) {
			//they just want ALL THE DATA.
			$retval = $this->data;
		}
		else {
			//get the list of indices in our data that we have to traverse.
			$myIndexList = $this->explode_path($path);
			
			//set an initial retval.
			$retval = $this->get_data_segment($this->data, $myIndexList[0]); 
			unset($myIndexList[0]);
			
			if(count($myIndexList) > 0) {
				foreach($myIndexList as $indexName) {
					$retval = $this->get_data_segment($retval, $indexName);
					if(is_null($retval)) {
						//hmm... well, if it's null, it's nothing which can have a sub-index.  Stop here.
						break;
					}
				}
			}
		}
		
		return($retval);
		
	}
765131
public function render($viewPath, array $data = null, $bypass = false)
	{
	    $this->setView($viewPath);

        if (!is_null($data)) {
            $this->setData($data);
        }


        if (!$this->isAjax() && $this->getLayout() !== null && !$bypass) {
            return $this->renderLayout($this->getSharedData());
        }

        return $this->renderView($this->getView(), $this->getData());
	}
1277998
public function data($path = null, $default = null, $strip = true)
    {
        return $this->arrGetXss($this->dataData(), $path, $default, $strip);
    }
905775
public function parse($_data)
    {
        $ctrlName = Config::getField('project', 'default_ctrl_name', 'main\\main');
        $methodName = Config::getField('project', 'default_method_name', 'main');
        $fd = Request::getFd();
        if (!empty($this->_buffer[$fd])) {
            $_data = $this->_buffer . $_data;
        }
        $packData = new MessagePacker($_data);
        $packLen = $packData->readInt();
        $dataLen = \strlen($_data);
        if ($packLen > $dataLen) {
            $this->_buffer[$fd] = $_data;
            return false;
        } elseif ($packLen < $dataLen) {
            $this->_buffer[$fd] = \substr($_data, $packLen, $dataLen - $packLen);
        } else {
            if (!empty($this->_buffer[$fd])) {
                unset($this->_buffer[$fd]);
            }
        }
        $packData->resetOffset();
        $params = $packData->readString();
        $data = \json_decode($params, true);
        $apn = Config::getField('project', 'ctrl_name', 'a');
        $mpn = Config::getField('project', 'method_name', 'm');
        if (isset($params[$apn])) {
            $ctrlName = \str_replace('/', '\\', $params[$apn]);
        }
        if (isset($params[$mpn])) {
            $methodName = $params[$mpn];
        }
        Request::init($ctrlName, $methodName, $data, Config::getField('project', 'view_mode', 'Zpack'));
        return true;
    }
1129898
public function loadExistingFileContentsFromCache($file_path)
    {
        $root_cache_directory = Config::getInstance()->getCacheDirectory();

        if (!$root_cache_directory) {
            return;
        }

        $file_cache_key = $this->getParserCacheKey(
            $file_path
        );

        $parser_cache_directory = $root_cache_directory . DIRECTORY_SEPARATOR . self::FILE_CONTENTS_CACHE_DIRECTORY;

        $cache_location = $parser_cache_directory . DIRECTORY_SEPARATOR . $file_cache_key;

        if (is_readable($cache_location)) {
            return file_get_contents($cache_location);
        }
    }
138732
public function getUrlByRoutePath($route_path)
    {
        if (null === $url = $this->getRouteCollection()->getRoutePath($route_path)) {
            $url = '/';
        }

        return $url;
    }
194926
public static function get($file, $data = [])
    {
        $path = self::load('views.' . $file);

        extract($data, EXTR_SKIP);

        include $path;
    }
1171488
public function get($_tpl, $data = array(), $_compiler = null, $_output = false)
    {
        if ($_compiler === null) {
            $_compiler = $this->compiler;
        }

        return parent::get($_tpl, $data, $_compiler, $_output);
    }
1056408
def contents(self, path=None):
        
        if isinstance(path, object) and hasattr(path, 'name'):
            log.debug("passed an object, use .'name' as path value")
            # passed an object, use .'name' as path value
            path = '/%s' % path.name
        c = self._jfs.get('%s%s' % (self.path, path or '/'))
        return c
811153
public function get($__path, $__data = array(), $__charset = null)
    {
        //TODO 这里是传递给extends的模板,此处由于是单例并且extends最后执行,如果在view里面再次使用view()->display()则会覆盖上次的data,因此View需要使用工厂模式产生新的实例,未实现
        $this->data = $__data;
        //composer
        if (isset($this->composers[$__path]) && $this->composers[$__path]) {
            foreach ($this->composers[$__path] as $composer) {
                $__composer_data = app()->make($composer)->compose($__data);
                $__data          = array_merge($__data, (array)$__composer_data);
            }
        }

        $ob_level = ob_get_level();
        ob_start();
        $__data = array_merge($this->global_data, $__data);

        if ($__charset == null) {
            $__charset = config('app.charset');
        }
        static $is_header = false;
        if (!$is_header) {
            $is_header = true;
            header('Content-type: text/html; charset=' . $__charset);
        }
        if (file_exists($this->getPath() . $__path)) {
            if ($__data) {
                extract($__data);
            }
            // We'll evaluate the contents of the view inside a try/catch block so we can
            // flush out any stray output that might get out before an error occurs or
            // an exception is thrown. This prevents any partial views from leaking.
            try {
                include $this->getPath() . $__path;
            } catch (\Exception $e) {
                $this->handleViewException($e, $ob_level);
            }
        } else {
            throw new HttpResponseException('Not found View file in: ' . $this->getPath() . $__path, HttpResponseException::ERR_NOTFOUND_VIEW);
        }

        return ltrim(ob_get_clean());
    }
197478
public function renderView($viewPath, array $data = null)
    {
        $this->setView($viewPath);

        !$data or extract($data);
        ob_start();

        if (file_exists(rtrim(
                $this->getViewPath(), $this->getFileExt()
            ) . $this->getFileExt())) {

            /** @noinspection PhpIncludeInspection */
            include rtrim(
                    $this->getViewPath(), $this->getFileExt()
                ) . $this->getFileExt();

        } elseif (file_exists(rtrim(
                $this->getViewFallbackPath(), $this->getFileExt()
            ) . $this->getFileExt())) {

            /** @noinspection PhpIncludeInspection */
            include rtrim(
                    $this->getViewFallbackPath(), $this->getFileExt()
                ) . $this->getFileExt();

        } else {
            throw new ViewNotFoundException('View ' . rtrim(
                    $this->getViewPath(), $this->getFileExt()
                ) . $this->getFileExt() . ' not found');
        }

        $rendered = ob_get_contents();
        ob_end_clean();

        return $rendered;
    }
944780
static function get_template_part($template_file, $data = []) {
    $engine = new Templating\TwigHAMLEngine();
    echo $engine->render_template($template_file . '.haml', $data);
  }
56915
protected function getPath($file_name, $path='controller')
    {
        if($path == "controller")
        {
            return './app/Http/Controllers/' . $file_name . '.php';
        }
        elseif($path == "request")
        {
            return './app/Http/Requests/'.$file_name.'.php';
        }
        elseif($path == "observer")
        {
            return './app/Observers/'.$file_name.'.php';
        }
        elseif($path == "policy")
        {
            return './app/Policies/'.$file_name.'.php';
        }
        elseif($path == "factory")
        {
            return './database/factories/'.$file_name.'Factory.php';
        }
        elseif($path == "model")
        {
            return './app/Models/'.$file_name.'.php';
        }
        elseif($path == "model-trait")
        {
            return './app/Models/Traits/'.$file_name.'Operation.php';
        }
        elseif($path == "seed")
        {
            return './database/seeds/'.$file_name.'.php';
        }
        elseif($path == "view-index")
        {
            return './resources/views/'.$file_name.'/index.blade.php';
        }
        elseif($path == "view-edit")
        {
            return './resources/views/'.$file_name.'/edit.blade.php';
        }
        elseif($path == "view-show")
        {
            return './resources/views/'.$file_name.'/show.blade.php';
        }
        elseif($path == "view-create")
        {
            return './resources/views/'.$file_name.'/create.blade.php';
        }
        elseif($path == "localization"){
            return './resources/lang/'.$file_name.'.php';
        }
        elseif($path == "route"){
            return './routes/web.php';
        }
        elseif($path == "route_old"){
            return './app/Http/routes.php';
        }
    }
1213819
public function get()
	{
		$__data = $this->data();

		// The contents of each view file is cached in an array for the
		// request since partial views may be rendered inside of for
		// loops which could incur performance penalties.
		$__contents = $this->load();

		ob_start() and extract($__data, EXTR_SKIP);

		// We'll include the view contents for parsing within a catcher
		// so we can avoid any WSOD errors. If an exception occurs we
		// will throw it out to the exception handler.
		try
		{
			eval('?>'.$__contents);
		}

		// If we caught an exception, we'll silently flush the output
		// buffer so that no partially rendered views get thrown out
		// to the client and confuse the user with junk.
		catch (\Exception $e)
		{
			ob_get_clean(); throw $e;
		}

		$content = ob_get_clean();

		// The view filter event gives us a last chance to modify the
		// evaluated contents of the view and return them. This lets
		// us do something like run the contents through Jade, etc.
		if (Event::listeners('view.filter'))
		{
			return Event::first('view.filter', array($content, $this->path));
		}

		return $content;
	}