Download the PHP package cutephp/route without Composer
On this page you can find all versions of the php package cutephp/route. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download cutephp/route
More information about cutephp/route
Files in cutephp/route
Download cutephp/route
More information about cutephp/route
Files in cutephp/route
Please rate this library. Is it a good library?
Informations about the package route
安装
在你的composer.json中添加
使用
添加基本路由
调用和HTTP方法同名的函数名来添加路由,第一个参数为接受的URI,第二个参数为任意类型。匹配成功后可通过getStorage()方法原样取出。
注意:GET路由会同意匹配HEAD请求。
获得匹配的路由
会看到结果为这是/about路由的输出
添加同时支持多种HTTP方法的路由
通过调用via方法传入多个http方法名
有名字的路由
添加可以接受参数的路由
路由参数节点使用:做前缀标识
输出结果为
添加可选参数的路由
这时/users或/users/1都可匹配到此路由。如果匹配/users/1,getParams()还可获得id对应1的数组。
All versions of route with dependencies
PHP Build Version
Package Version
No informations.
The package cutephp/route contains the following files
Loading the files please wait ...