FEATURE: add template check on content overview

This commit is contained in:
Michal Kváček
2016-09-20 14:47:38 +02:00
parent df9ff7b259
commit e8b91db6f2
4 changed files with 85 additions and 64 deletions
+7 -3
View File
@@ -13,7 +13,7 @@ class Template
*
* @return null|string
*/
public static function name($template)
public static function name($template, $throwExceptions = true)
{
$namespace = null;
if (strpos($template, '::')) {
@@ -32,8 +32,12 @@ class Template
}
}
if (is_null($view)) {
throw new InvalidArgumentException('Cannot find template for ' . $namespace . $template);
if ($throwExceptions) {
if (is_null($view)) {
throw new InvalidArgumentException('Cannot find template for ' . $namespace . $template);
}
} else {
return false;
}
return $view;