How does thinkphp extend the core class?

Source: Internet
Author: User
How does thinkphp extend the core class? How does thinkphp extend the core class? For example, if I want to extend the routing class, first inherit the core routing class of thinkphp, and then let thinkphp run my extended routing class instead of the original core routing class?

We have 25 minutes left. can you help me ~~


Reply to discussion (solution)

Extend the core class, that is, you need to call some more of your own calls to remove the default framework. the loss of the extension file depends on your own wishes, the key point is that you need to step by step find out which route control is introduced.

Extend the core class, that is, you need to call some more of your own calls to remove the default framework. the loss of the extension file depends on your own wishes, the key point is that you need to step by step find out which route control is introduced.



The introduced content is also the core class. if you replace it directly, it will change the core class of tp. you just want to extend it without having to change the core class of tp. Otherwise, you will change the routing class of tp directly.


Extend the core class, that is, you need to call some more of your own calls to remove the default framework. the loss of the extension file depends on your own wishes, the key point is that you need to step by step find out which route control is introduced.



The introduced content is also the core class. if you replace it directly, it will change the core class of tp. you just want to extend it without having to change the core class of tp. Otherwise, you will change the routing class of tp directly.

You can add a configuration and add a judgment to the core class. if the configuration uses the built-in TP, it will call the original TP; otherwise, it will be better to call the custom one.

Read the "behavior extension" section in the manual carefully.

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.