CodeIgniter用ChromePHP來debug[PHP]

以前寫PHP都用var_dump來debug

現在改用ChromePHP來debug

ChromePHP是Chrome上的套件

在Firefox上也有Firephp

ChromePHP使用上也非常簡單

先到chrome web store

安裝ChromePHP套件

在去ChromePHP官網下載ChromePhp.php檔案

chromephp官網:http://www.chromephp.com/

接著只有在需要用的時後

include 'ChromePhp.php';
ChromePhp::log('需要輸出的var');

這樣一來就可以在Chrome控制台上的console看到輸出的訊息

如果要在CodeIgniter上使用

需要修改一下ChromePhp.php

把用本的private function __construct()

修改為public function __construct()

$this->load->library('ChromePhp');
$this->chromephp->log('需要輸出的var');

2 關於 “CodeIgniter用ChromePHP來debug[PHP]” 的評論

Tomato Blue 發表迴響 取消回覆

你的電子郵件位址並不會被公開。 必要欄位標記為 *