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:
parent
c1d0adc845
commit
5bfde258b1
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
2
init.php
2
init.php
|
@ -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);
|
||||
}
|
Loading…
Reference in a new issue