Archive for the ‘PHP’ Category
Codeigniter 2.0 configurable profiler + some jQuery magic to show/hide
The new CI 2.0 Profiler has configurable sections + 2 new additional sections (http_headers and config).
You’ll need to edit application/config/profiler.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| Profiler Sections
| -------------------------------------------------------------------------
| This file lets you determine whether or not various sections of Profiler
| data are displayed when the Profiler is enabled.
| Please see the user guide for info:
|
| http://codeigniter.com/user_guide/general/profiling.html
|
*/
$config['benchmarks'] = TRUE;
$config['get'] = TRUE;
$config['memory_usage'] = TRUE;
$config['post'] = TRUE;
$config['uri_string'] = TRUE;
$config['controller_info'] = TRUE;
$config['queries'] = TRUE;
$config['http_headers'] = TRUE;
$config['config'] = TRUE;
/* End of file profiler.php */
/* Location: ./application/config/profiler.php */
I previously used a modified version of MY_Profiler from dragffy.com. I modified it to add a button to the top of the page that would show or hide the profiler when needed and could also hide the profiler button totally.
Click to continue reading “Codeigniter 2.0 configurable profiler + some jQuery magic to show/hide”
Quick and easy block commenting for testing
To save time commenting and uncommenting during development we use a little trick with the comment block that allows us to add or remove a single character ‘\’ to comment/uncomment a block.
Uncommented
/* */ Block of code /* */
Commented
/* *\/ Block of code /* */
Quick and simple time saver