parent
c76e4e3583
commit
a9819907ed
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue