protected function _paths($type, array $params) {
		if (!isset($this->_paths[$type])) {
			throw new TemplateException("Invalid template type '{$type}'.");
		}

		foreach ((array) $this->_paths[$type] as $path) {
			if (!file_exists($path = Text::insert($path, $params))) {
				continue;
			}
			return $path;
		}
		throw new TemplateException("Template not found at path `{$path}`.");
	}
protected function _paths($type, array $params) {
		if (!isset($this->_paths[$type])) {
			throw new TemplateException("Invalid template type '{$type}'.");
		}

		foreach ((array) $this->_paths[$type] as $path) {
			if (!file_exists($path = Text::insert($path, $params))) {
				continue;
			}
			return $path;
		}
		throw new TemplateException("Template not found at path `{$path}`.");
	}
protected function _paths ( $ type , array $ params ) { if ( ! isset ( $ this -> _paths [ $ type ] ) ) { throw new TemplateException ( "Invalid template type '{$type}'." ) ; } foreach ( ( array ) $ this -> _paths [ $ type ] as $ path ) { if ( ! file_exists ( $ path = Text :: insert ( $ path , $ params ) ) ) { continue ; } return $ path ; } throw new TemplateException ( "Template not found at path `{$path}`." ) ; }
Searches one or more path templates for a matching template file, and returns the file name.

@param string $type
@param array $params The set of options keys to be interpolated into the path templates
when searching for the correct file to load.
@return string Returns the first template file found. Throws an exception if no templates
are available.
Searches one or more path templates for a matching template file and returns the file name .