lithium\template\view\adapter\File::_paths PHP Method

_paths() protected method

Searches one or more path templates for a matching template file, and returns the file name.
protected _paths ( string $type, array $params ) : string
$type string
$params array 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.
    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 = String::insert($path, $params))) {
                continue;
            }
            return $path;
        }
        throw new TemplateException("Template not found at path `{$path}`.");
    }