src/mako/view/ViewFactory.php
protected function getViewPathAndExtension(string $view, bool $throwException = true)
	{
		if(!isset($this->viewCache[$view]))
		{
			// Loop throught the avaiable extensions and check if the view exists

			foreach($this->renderers as $extension => $renderer)
			{
				$paths = $this->getCascadingFilePaths($view, $extension);

				foreach($paths as $path)
				{
					if($this->fileSystem->has($path))
					{
						return $this->viewCache[$view] = [$path, $extension];
					}
				}
			}

			// We didn't find the view so we'll throw an exception or return false

			if($throwException)
			{
				throw new ViewException(vsprintf('The [ %s ] view does not exist.', [$view]));
			}

			return false;
		}

		return $this->viewCache[$view];
	}
protected function getViewPathAndExtension(string $view, bool $throwException = true)
	{
		if(!isset($this->viewCache[$view]))
		{
			// Loop throught the avaiable extensions and check if the view exists

			foreach($this->renderers as $extension => $renderer)
			{
				$paths = $this->getCascadingFilePaths($view, $extension);

				foreach($paths as $path)
				{
					if($this->fileSystem->has($path))
					{
						return $this->viewCache[$view] = [$path, $extension];
					}
				}
			}

			// We didn't find the view so we'll throw an exception or return false

			if($throwException)
			{
				throw new ViewException(vsprintf('The [ %s ] view does not exist.', [$view]));
			}

			return false;
		}

		return $this->viewCache[$view];
	}
protected function getViewPathAndExtension ( string $ view , bool $ throwException = true ) { if ( ! isset ( $ this -> viewCache [ $ view ] ) ) { // Loop throught the avaiable extensions and check if the view exists foreach ( $ this -> renderers as $ extension => $ renderer ) { $ paths = $ this -> getCascadingFilePaths ( $ view , $ extension ) ; foreach ( $ paths as $ path ) { if ( $ this -> fileSystem -> has ( $ path ) ) { return $ this -> viewCache [ $ view ] = [ $ path , $ extension ] ; } } } // We didn't find the view so we'll throw an exception or return false if ( $ throwException ) { throw new ViewException ( vsprintf ( 'The [ %s ] view does not exist.' , [ $ view ] ) ) ; } return false ; } return $ this -> viewCache [ $ view ] ; }
Returns an array containing the view path and the renderer we should use.

@param  string                   $view           View
@param  bool                     $throwException Throw exception if view doesn't exist?
@throws \mako\view\ViewException
@return array|bool
Returns an array containing the view path and the renderer we should use .