From daea5fee2db3cf030796ec5463577688cadc3d8c Mon Sep 17 00:00:00 2001 From: Dayle Rees Date: Thu, 29 Mar 2012 21:18:06 +0100 Subject: [PATCH] changed anbu to load automatically at end of request- taylors idea --- application/config/anbu.php | 13 +++++++++++++ application/views/home/index.php | 1 - laravel/anbu/anbu.php | 9 +++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/application/config/anbu.php b/application/config/anbu.php index 9b6503ee..148d2933 100644 --- a/application/config/anbu.php +++ b/application/config/anbu.php @@ -3,6 +3,19 @@ return array( + /* + |-------------------------------------------------------------------------- + | Enable Anbu + |-------------------------------------------------------------------------- + | + | This will cause anbu to be rendered on every request, if you would prefer + | to enable anbu in your templates manually, simply add Anbu::render(); + | after the tag. + | + */ + + 'enable' => true, + /* |-------------------------------------------------------------------------- | Show the LOG tab. diff --git a/application/views/home/index.php b/application/views/home/index.php index 980248f3..562a72bb 100755 --- a/application/views/home/index.php +++ b/application/views/home/index.php @@ -88,7 +88,6 @@ -

Welcome To Laravel

diff --git a/laravel/anbu/anbu.php b/laravel/anbu/anbu.php index 693d4b03..e2e7c4e7 100755 --- a/laravel/anbu/anbu.php +++ b/laravel/anbu/anbu.php @@ -3,6 +3,7 @@ use Laravel\View; use Laravel\File; use Laravel\Config; +use Laravel\Event; /** * Anbu, the light weight profiler for Laravel. @@ -92,6 +93,14 @@ public static function register() // modify them $listener = Config::get('anbu.event_listeners'); $listener(); + + // echo anbu on laravel.done if enabled + if(Config::get('anbu.enable')) + { + Event::listen('laravel.done', function() { + Anbu::render(); + }); + } } }