Coherent Operation Analysis

Source: Internet
Author: User

Brief Introduction: This is a detailed page for coherent operation analysis. It introduces related knowledge, skills, experiences, and some PHP source code.

Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 337543 'rolling = 'no'> basic idea: Save the content to be operated using the _ call method of PHP and execute the last step.

Knowing this idea will soon be able to build suchProgram:

<? Phpclass test {protected $ Options = array (); public function _ call ($ method, $ ARGs) {If (in_array ($ method, array ('where ', 'data', 'add') {$ this-> options [] = $ ARGs [0];} else {echo 'method you are operating on '. $ method. 'nonexistent ';}} public function display () {return $ this-> options ;}}$ test = new test (); $ result = $ test-> where ('a = 1, B = 2')-> display (); var_dump ($ result);?>

Output result:

Return to the thinkphp source code, and find that every time the method is executed, there will be a sentence: return $ this;

Returning the object itself is a crucial step in a coherent operation. After returning the object itself, the execution method will not fail to be found when performing the next operation.

Love J2EE follow Java Michael Jackson video station JSON online tools

Http://biancheng.dnbcw.info/php/337543.html pageno: 9.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.