How PHP tracks debugging on a browser and a brief introduction to using chromephp
Before using thinkphp found a trace function can track debugging, feel very interesting, online search for the next similar things, found the chromephp, did not think of this to debug PHP program, feel very convenient, very useful.
thinkphp use of their own generated HTML with the template output to display, occasionally encounter some inexplicable problems, the effect is not too good,
There are some similar methods, but the main output is to add JS code in the template, call the browser debugging method for output debugging
such as Console.log (' Some debug output content of PHP ');
Chromephp is through the header to transfer debugging content and through the installation of Chrome browser plugin to read the header information displayed in the browser debug panel to view, the function is more powerful, there is not much interference on the page, debugging is more convenient, Firefox is said to have similar firephp , but I don't know how to use Firefox to test it now.
Website address:
http://www.chromelogger.com/
This is the Github address for the Open source project:
github:https://github.com/ccampbell/chromephp
This is the installation address of the Chrome kernel browser plugin:
Https://chrome.google.com/extensions/detail/noaneddfkdjfnfdakjjmocngnfkfehhd
But always by the wall, not open, and can only be Google Chrome to install, I found long time only found a 3.0 plug-in
Plugin Download Address:
http://download.csdn.net/detail/zsjangel/7535201
Can be installed after try to upgrade to the latest 4.1, I was so successful
The 3.0 plugin icon is not the same as 4.1:
The following is the 4.1 version, Black is indicated as the open plugin, click Start
Blue on the bottom indicates start, debugging information can be seen in the panel
How to use PHP:
Chromephp::log (' Hello console! '); Chromephp::group (' This is group '); Chromephp::log (' Hi God's snail! '); Chromephp::error (' something went wrong! '); Chromephp::groupend (); Chromephp::table (Array (' AA ' = ' BB ', ' cc ' =>11), array (' aa ' = ' = ' cc ', ' cc ' =>22));
Group indicates that all of the following is a set of debugging information, until the end of GroupEnd, the display effect and the normal log is not the same
Table parameter must be a two-dimensional array, otherwise it will not be displayed, the key name of the array and the field name
Here are the following: