mirror of
https://github.com/Oreolek/debug-toolbar.git
synced 2024-05-05 10:38:14 +03:00
Improve custom's sections rendering
This commit is contained in:
parent
faa657a088
commit
3f6a4c854e
|
@ -213,9 +213,14 @@ abstract class Kohana_Debugtoolbar {
|
||||||
foreach(self::$_custom_sections as $section)
|
foreach(self::$_custom_sections as $section)
|
||||||
{
|
{
|
||||||
list($title, $data, $logo) = $section;
|
list($title, $data, $logo) = $section;
|
||||||
|
if ( ! is_string($data) && is_callable($data))
|
||||||
|
{
|
||||||
|
$data = call_user_func($data);
|
||||||
|
}
|
||||||
|
|
||||||
$result[] = array(
|
$result[] = array(
|
||||||
'title' => is_callable($title) ? call_user_func($title) : (string)$title,
|
'title' => ! is_string($title) && is_callable($title) ? call_user_func($title) : (string)$title,
|
||||||
'content' => is_callable($data) ? call_user_func($data) : $data,
|
'content' => is_string($data) ? $data : Debug::dump($data),
|
||||||
'logo' => $logo
|
'logo' => $logo
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue