CodeIgniter用ChromePHP來debug[PHP]

jackxiang 2015-5-4 23:13 | |
背景:写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');
来自:http://blog.ipushs.com/codeigniter%E7%94%A8chromephp%E4%BE%86debugphp/?replytocom=78

作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:http://jackxiang.com/post/8011/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!

评论列表
发表评论

昵称

网址

电邮

打开HTML 打开UBB 打开表情 隐藏 记住我 [登入] [注册]