Skip to content

Commit

Permalink
Register dump() and stopwatch() twig extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
Flynsarmy committed Aug 12, 2014
1 parent 5d0bf0d commit 5c15c0b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Plugin.php
Expand Up @@ -3,6 +3,7 @@
use App;
use System\Classes\PluginBase;
use Illuminate\Foundation\AliasLoader;
use Event;

/**
* DebugBar Plugin Information File
Expand Down Expand Up @@ -30,13 +31,19 @@ public function pluginDetails()
*/
public function boot()
{
// Register ServiceProviders
App::register('\Barryvdh\Debugbar\ServiceProvider');

/*
* Register aliases
*/
// Register aliases
$alias = AliasLoader::getInstance();
$alias->alias('Debugbar', 'Barryvdh\Debugbar\Facade');

// Register Twig extensions
Event::listen('cms.page.beforeDisplay', function($controller, $url, $page) {
$twig = $controller->getTwig();
$twig->addExtension(new \Barryvdh\Debugbar\Twig\Extension\Debug($this->app));
$twig->addExtension(new \Barryvdh\Debugbar\Twig\Extension\Stopwatch($this->app));
});
}

public function register()
Expand Down

0 comments on commit 5c15c0b

Please sign in to comment.