Routes Shell
New in version 3.1: The RoutesShell was added in 3.1
The RoutesShell provides a simple to use CLI interface for testing and debuggingroutes. You can use it to test how routes are parsed, and what URLs routingparameters will generate.
Getting a List of all Routes
- bin/cake routes
Testing URL parsing
You can quickly see how a URL will be parsed using the check
method:
- bin/cake routes check /bookmarks/edit/1
If your route contains any query string parameters remember to surround the URLin quotes:
- bin/cake routes check "/bookmarks/?page=1&sort=title&direction=desc"
Testing URL Generation
You can see how which URL a routing array will generate using thegenerate
method:
- bin/cake routes generate controller:Bookmarks action:edit 1
当前内容版权归 cakephp.org 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 cakephp.org .