What's the word for PHP routing?

Source: Internet
Author: User
What's the word for PHP routing?

Reply content:

What's the word for PHP routing?

What you call a router is actually a reason to accept the request through a portal and then distribute the request to a different place through the (URL) matching rules. specifically to some mainstream frameworks, the router module parses the request with an HTTP module, parses the route according to a certain rule, and then uses the dispatch module to adjust the logic to a block of code (usually the controller) and finally to return the response (Response).

So you take this route as the router that the home uses to surf the net, the reason is same.

For example, the user's access link is detected, http://fuck.io/article/1 it will be called ArticleController showArticle($id) , and the latter as a 1 parameter passed in assigned to $id .

The definition of the route itself is the message-passing person, and here is the meaning of the road to the request.

The URL is assigned to the corresponding processing logic

The so-called route is currently a popular single-entry site , We only access this file: index.php , such as our access to HTTP// domain name/index.php?class=xxxx& Method=xxxxx means to execute a certain method within a class. Different parameters, then the method of execution is different. See, all that stuff is based on the parameters passed in to execute those code.

Routing is a intersection with a lot of intersections, different people from different routes (different URLs) came here, through the traffic police to their directions (route distribution), have found his way, ran their destination.

Originally written PHP program called URL, but this call not enough on the grade, and then out of more than 300 PHP framework, called routing, URL immediately high-end atmospheric grade

  • Related Article

    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.