0
In Cakephp 2 I usually enable/disable Debubkit by Appcontroller, according to the user who is logged in to the system:
// AppController -> CakePHP 2
public function beforeFilter(){
parent::beforeFilter();
...
if($this->usuario_logado_id > 1)
Configure::write('debug', 0);
}
However, in Cakephp 3, Debugkit is loaded from "Application.php"
// Application.php -> CakePHP 3
public function bootstrap(){
parent::bootstrap();
...
$this->addPlugin(\DebugKit\Plugin::class);
}
Is there any way to disable Debubkit from Appcontroller as I do in Cakephp 2 ?
I’ve tried many different ways, but without success.
You can disable the configuration file (config/app.php) by setting the debug flag to false
– Julyano Felipe
From what I read in the documentation, it is not possible to do it by a controller, only by Application.php
– Julyano Felipe
The problem with disabling the.php app is that it should be manual. In Cakephp2 I enable it for myself and leave it disabled for other users.
– Felipe Parente
you use Debugkit or just debug? debug is possible to have its dynamic value the way you want, debugkit is not possible
– Julyano Felipe
The debug I managed to disable dynamically... Debugkit does not, sometimes it is necessary to use it.
– Felipe Parente