FEATURE: add template check on content overview
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user