Posts tagged with: profiler

CodeIgniter Profiler: Globally Enable/Disable

Here is a quick tip for users of the CodeIgniter PHP Framework (and a reminder to myself). If you wish to enable or disable the profiler globally while developing your application (as opposed to changing the value in each seperate controller), you can do the following.

1. Open the config.php file in the application/config/ folder.
2. Add a new config setting using the following code:

/*
|---------------------------------
| Globally Enable/Disable Profiler
|---------------------------------
|
| TRUE  = On
| FALSE = Off
|
*/
$config['profiler_status'] = TRUE;

3. Then in each of the controllers that you want to the profiler to be displayed on, add the following code to the constructor.

$this->output->enable_profiler($this->config->item('profiler_status'));

Note: If you prefer to only have the profiler be displayed on some methods, then place the code from step 3 above into each of the methods.

Hope  this helps :)