The Problem is we cannot print messages,errors directly into the applications interface. Sometime CodeIgniter will suppress your echo command.
FirePHP handle these message excellent. To use firePHP with codeigniter you want to integrate the FirePHP Core Library (download it) to your codeigniter application.
extract the FirePHP.class.php from the archive, rename it to firephp.php and copy in the system/application/libraries directory of your CodeIgniter application
Now you can use FirePHP to debug your codeigniter Application:
load the library into your controller : $this->load->library('firephp')
send debug messages to the FireBug console : $this->firephp->log($myvariable) or $this->firephp->error('Error at this line')
A More Detailed instruction about FirePHP is in the website
$this->firephp->log($myvariable) : send a dump of the variable $myvariable on the FireBug console
$this->firephp->warn($myvariable) : send a dump of the variable $myvariable on the FireBug console classified as a warning
$this->firephp->error($myvariable) : send a dump of the variable $myvariable on the FireBug console classified as an error
Here there is a little example:
<?php$this->load->library('firephp');$myvariable=array('language'=>'PHP','database'=>'MySQL','blogging platform'=>'WordPress','post'=>'CodeIgniter and FirePHP',);$this->firephp->log($myvariable);?>
The debug messages can be disabled with the method : $this->firepgp->setEnabled(FALSE).
And this is the output
FirePHP Consile
More Stories
1 thought on “CodeIgniter with firePHP – FireBug Extension”
I use Fire Bug. The tool is very helpful in developing php applications.