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}`.");
}