1
0
Fork 0
mirror of https://github.com/Oreolek/debug-toolbar.git synced 2024-06-16 23:00:50 +03:00

Sometimes KDT should just return toolbar's text, implements #30

This commit is contained in:
biakaveron 2013-07-21 23:50:35 +04:00
parent c1d0adc845
commit 5bfde258b1
2 changed files with 13 additions and 3 deletions

View file

@ -48,10 +48,12 @@ abstract class Kohana_Debugtoolbar {
/**
* Renders the Debug Toolbar
*
* @param bool $print return DT's template (FALSE) or render it (TRUE, by default)
*
* @static
* @return bool|string
*/
public static function render()
public static function render($print = FALSE)
{
if ( ! self::is_enabled())
{
@ -133,7 +135,15 @@ abstract class Kohana_Debugtoolbar {
$template->set('styles', $styles);
echo $template->render();
$result = $template->render();
if ($print === TRUE)
{
echo $result;
}
else {
return $result;
}
}
/**

View file

@ -15,5 +15,5 @@ if (Kohana::$config->load('debug_toolbar.firephp_enabled') === TRUE)
// Render Debug Toolbar on the end of application execution
if (Kohana::$config->load('debug_toolbar.auto_render') === TRUE)
{
register_shutdown_function('Debugtoolbar::render');
register_shutdown_function('Debugtoolbar::render', TRUE);
}