What is PHP route? Is there any other popular saying?

Source: Internet
Author: User
What is PHP route? Is there any popular saying about PHP route?

Reply content:

What is PHP route? Is there any other popular saying?

What you call a route is actually the same as a router. It accepts requests through an ingress and distributes requests to different places through URL matching rules. Specific to some mainstream frameworks, the Router module will work with the Http module to analyze requests and parse the requests according to certain rules to match the routes, then, use the scheduling module to adjust the logic to a piece of code (usually the Controller), and finally return the Response ).

So you think of this route as a router for accessing the internet at home. The truth is the same.

For example, if the user's access link ishttp://fuck.io/article/1To callArticleControllerOfshowArticle($id)And1Input as a parameter and assign it$id.

The route itself is defined as the information transmitter, which is used to direct requests.

The url is assigned to the corresponding processing logic.

The so-called route is currently popularSingle portal websiteOne way,We only access this file: index. phpFor exampleHttp: // domain name/index. php? Class = xxxx & method = xxxxxIs to execute a method in a certain class. If the input parameters are different, the execution method is different. Everything depends on the input parameters to execute the code.

A route is an intersection with many intersections. Different people come here from different routes (different URLs) and give directions to them through the traffic police (route distribution ), he found his path and ran to their destination.

The original php program is called url, but this is not a high level. Later, more than 300 php frameworks were developed and changed to routing. The url was immediately upgraded to a high level.

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.