src/ViewManager.php
public function forge($view, array $data = null, $filter = null)
	{
		if ( ! $file = $this->findView($view))
		{
			throw new Exception\ViewNotFound('Could not locate view: '.$view);
		}

		if ($filter === null)
		{
			$filter = $this->autoFilter;
		}

		$extension = pathinfo($file, PATHINFO_EXTENSION);

		if ( ! isset($this->parsers[$extension]))
		{
			throw new \DomainException('Could not find parser for extension: '.$extension);
		}

		$parser = $this->parsers[$extension];
		$view = new View($this, $parser, $file, $filter);

		if ($data)
		{
			$view->set($data);
		}

		return $view;
	}
public function forge($view, array $data = null, $filter = null)
	{
		if ( ! $file = $this->findView($view))
		{
			throw new Exception\ViewNotFound('Could not locate view: '.$view);
		}

		if ($filter === null)
		{
			$filter = $this->autoFilter;
		}

		$extension = pathinfo($file, PATHINFO_EXTENSION);

		if ( ! isset($this->parsers[$extension]))
		{
			throw new \DomainException('Could not find parser for extension: '.$extension);
		}

		$parser = $this->parsers[$extension];
		$view = new View($this, $parser, $file, $filter);

		if ($data)
		{
			$view->set($data);
		}

		return $view;
	}
public function forge ( $ view , array $ data = null , $ filter = null ) { if ( ! $ file = $ this -> findView ( $ view ) ) { throw new Exception \ ViewNotFound ( 'Could not locate view: ' . $ view ) ; } if ( $ filter === null ) { $ filter = $ this -> autoFilter ; } $ extension = pathinfo ( $ file , PATHINFO_EXTENSION ) ; if ( ! isset ( $ this -> parsers [ $ extension ] ) ) { throw new \ DomainException ( 'Could not find parser for extension: ' . $ extension ) ; } $ parser = $ this -> parsers [ $ extension ] ; $ view = new View ( $ this , $ parser , $ file , $ filter ) ; if ( $ data ) { $ view -> set ( $ data ) ; } return $ view ; }
Attempts to find and load the given view

@param string    $view
@param array     $data
@param null|bool $filter

@return View

@throws Exception\ViewNotFound If the given view cannot be found
@throws \DomainException       If a parser for the view cannot be found
Attempts to find and load the given view