From af01a82c916c331dc846d4be14f3b8bef8ce605e Mon Sep 17 00:00:00 2001 From: biakaveron Date: Fri, 16 Aug 2013 08:33:23 +0400 Subject: [PATCH] Added excluded_routes param (implements #32) --- classes/Kohana/Debugtoolbar.php | 5 +++++ config/debug_toolbar.php | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/classes/Kohana/Debugtoolbar.php b/classes/Kohana/Debugtoolbar.php index b26a3db..a06e2d7 100644 --- a/classes/Kohana/Debugtoolbar.php +++ b/classes/Kohana/Debugtoolbar.php @@ -488,6 +488,11 @@ abstract class Kohana_Debugtoolbar { return FALSE; } + if ( ! empty($config->excluded_routes) && in_array(Route::name(Request::initial()->route()), $config->excluded_routes)) + { + return FALSE; + } + return TRUE; } } \ No newline at end of file diff --git a/config/debug_toolbar.php b/config/debug_toolbar.php index 84640e9..94581e2 100644 --- a/config/debug_toolbar.php +++ b/config/debug_toolbar.php @@ -42,4 +42,11 @@ $config['align'] = 'right'; */ $config['secret_key'] = FALSE; +/** + * Disabled routes + */ +$config['excluded_routes'] = array( + 'docs/media' // Userguide media route +); + return $config; \ No newline at end of file