Home >Backend Development >PHP Tutorial >Summary of debugging methods developed based on Thinkphp323 framework

Summary of debugging methods developed based on Thinkphp323 framework

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-29 09:11:231264browse

1 php

?? You can use echo, print, dump(), return, etc. in the method.
??By running the operation method in the browser: localhost/controller name/method name/parameter name 1/parameter value 1/parameter name 2/parameter value 2...

2 js

alert(variable or Constant);
console.log (variable or constant);

3 ajax + js + php

?? This process is executed in the background and is invisible, but how do you want to know what the variables in the middle are? Passed, what has changed? How to debug it?
??First we observe the output of the variable in the browser's console.
Method: Through the method ajaxReturn function in the controller, the variable to be viewed can be returned.
Variable view settings: If you set the dataType parameter of ajax to 'text', you can see the text format of the variable. This has the advantage that if an error is encountered, we can see when we only have php in the first section. All information printed on the page can be seen:
Summary of debugging methods developed based on Thinkphp323 framework
??Of course, if it is set to json format, then you will not be able to see it. You can only see the correct value of the variable, and there will be no prompt. This method can help us know exactly what error occurred and find the error accurately.

').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

The above has introduced a summary of debugging methods developed based on the Thinkphp323 framework, including ajax content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn