Skip to content
Serghei Iakovlev edited this page Apr 15, 2017 · 7 revisions

These routes must not be restricted by any security policy:

$router->addGet('/_debugbar/open',array(
    'namespace'=>'Snowair\Debugbar\Controllers',
    'controller'=>'\OpenHandler',
    'action'=>'handle',
))->setName('debugbar.openhandler');

$router->addGet('/_debugbar/assets/stylesheets',array(
    'namespace'=>'Snowair\Debugbar\Controllers',
    'controller'=>'Asset',
    'action'=>'css',
))->setName('debugbar.assets.css');

$router->addGet('/_debugbar/assets/javascript',array(
    'namespace'=>'Snowair\Debugbar\Controllers',
    'controller'=>'Asset',
    'action'=>'js',
))->setName('debugbar.assets.js');

eg. If you use ACL, these codes may be helpfull:

        $ns = $dispatcher->getNamespaceName();
        if ($ns=='Snowair\Debugbar\Controllers') {
            return true;
        }
        // Do ACL check logic

If you use volt engine, You must register 'volt' service in this way:

$di->set('volt', function($view, $di) {
    // the first parameter is $view, the second is $di, don't reverse the order!
    // code
}, true);

or

$di->set('volt', function() use($view, $di) {
    // I suggest you register it in this way!
    // code
}, true);

or

$di->set('volt', function() use( $di) {
    $view = $di['view'];
    // I suggest you register it in this way!
    // code
}, true);