system/View/Parser.php
public function render(string $view, array $options = null, bool $saveData = null): string
	{
		$start = microtime(true);
		if (is_null($saveData))
		{
			$saveData = $this->config->saveData;
		}

		$view = str_replace('.php', '', $view);

		// Was it cached?
		if (isset($options['cache']))
		{
			$cacheName = $options['cache_name'] ?: $view;

			if ($output = cache($cacheName))
			{
				$this->logPerformance($start, microtime(true), $view);
				return $output;
			}
		}

		$view = $view . '.php';
		$file = $this->viewPath . $view;

		if (! is_file($file))
		{
			$file = $this->loader->locateFile($view, 'Views');
		}

		// locateFile will return an empty string if the file cannot be found.
		if (empty($file))
		{
			throw ViewException::forInvalidFile($file);
		}

		$template = file_get_contents($file);
		$output   = $this->parse($template, $this->data, $options);
		$this->logPerformance($start, microtime(true), $view);

		if (! $saveData)
		{
			$this->data = [];
		}
		// Should we cache?
		if (isset($options['cache']))
		{
			cache()->save($cacheName, $output, (int) $options['cache']);
		}

		return $output;
	}
public function render(string $view, array $options = null, bool $saveData = null): string
	{
		$start = microtime(true);
		if (is_null($saveData))
		{
			$saveData = $this->config->saveData;
		}

		$view = str_replace('.php', '', $view);

		// Was it cached?
		if (isset($options['cache']))
		{
			$cacheName = $options['cache_name'] ?: $view;

			if ($output = cache($cacheName))
			{
				$this->logPerformance($start, microtime(true), $view);
				return $output;
			}
		}

		$view = $view . '.php';
		$file = $this->viewPath . $view;

		if (! is_file($file))
		{
			$file = $this->loader->locateFile($view, 'Views');
		}

		// locateFile will return an empty string if the file cannot be found.
		if (empty($file))
		{
			throw ViewException::forInvalidFile($file);
		}

		$template = file_get_contents($file);
		$output   = $this->parse($template, $this->data, $options);
		$this->logPerformance($start, microtime(true), $view);

		if (! $saveData)
		{
			$this->data = [];
		}
		// Should we cache?
		if (isset($options['cache']))
		{
			cache()->save($cacheName, $output, (int) $options['cache']);
		}

		return $output;
	}
Parse a template

Parses pseudo-variables contained in the specified template view,
replacing them with any data that has already been set.

@param string  $view
@param array   $options
@param boolean $saveData

@return string