diff --git a/library/Icinga/Web/Menu.php b/library/Icinga/Web/Menu.php index e95f14c88..056e2ff88 100644 --- a/library/Icinga/Web/Menu.php +++ b/library/Icinga/Web/Menu.php @@ -117,13 +117,17 @@ class Menu implements RecursiveIterator foreach ($props as $key => $value) { $method = 'set' . implode('', array_map('ucfirst', explode('_', strtolower($key)))); if ($key === 'renderer') { - $class = '\Icinga\Web\Menu\\' . $value; - if (!class_exists($class)) { - throw new ConfigurationError( - sprintf('ItemRenderer with class "%s" does not exist', $class) - ); + if (class_exists($value)) { + $value = new $value; + } else { + $class = '\Icinga\Web\Menu\\' . $value; + if (!class_exists($class)) { + throw new ConfigurationError( + sprintf('ItemRenderer with class "%s" does not exist', $class) + ); + } + $value = new $class; } - $value = new $class; } if (method_exists($this, $method)) { $this->{$method}($value);