Home  >  Article  >  Backend Development  >  laravel配置基本路由有几种方法

laravel配置基本路由有几种方法

PHPz
PHPzOriginal
2016-06-06 20:16:542460browse

laravel配置基本路由有3种方法:1、使用get或post方式配置路由;2、使用match方式配置路由,可以选择路由的接收方式;3、使用any方式配置路由,可以接收任何形式的路由。

laravel配置基本路由有几种方法

laravel配置路由有几种方法?

基本路由包含了几种配置方法 

使用get,post方式配置路由,这是最简单的路由配置方式

81745911bf90c622ec0d2dd52fb32ea.png

使用match方式配置路由,这种方式可以选择路由的接收方式674829a706fc9c84c7695e7c38f2dc1.png

使用any方式配置路由可以接收任何形式的路由

2af684bea9dbc29b4ce4e961b4da302.png

有了以上几种路由配置方式,我们可以对路由进行优化配置,给路由加上默认参数,并且对路由进行正则过滤

83a3f1ed8a6f47f9b1880e8b399bd06.png

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