Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I disable yii-debug-toolbar on a specific view?

How can I disable yii-debug-toolbar on a specific view especially on partial rendered views?

Is this possible?

p.s. Yii-debug-toolbar does unfortunately not exist as a tag below.

like image 531
Lonely Avatar asked May 09 '14 08:05

Lonely


2 Answers

Put this in your layout or view file:

if (class_exists('yii\debug\Module')) {
    $this->off(\yii\web\View::EVENT_END_BODY, [\yii\debug\Module::getInstance(), 'renderToolbar']);
}

This removes the callback that renders the toolbar from the event that runs at the end of the layout, where you have $this->endBody().

like image 181
spikyjt Avatar answered Oct 16 '22 14:10

spikyjt


Just Remove or comments out the those two lines from /config/web.php

$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = 'yii\debug\Module';
like image 20
Tanvir Rahman Avatar answered Oct 16 '22 13:10

Tanvir Rahman