Download the PHP package yiisoft/file-router without Composer
On this page you can find all versions of the php package yiisoft/file-router. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yiisoft/file-router
More information about yiisoft/file-router
Files in yiisoft/file-router
Package file-router
Short Description Convention-based file structure router
License BSD-3-Clause
Homepage https://www.yiiframework.com/
Informations about the package file-router
Yii File Router
The package provides a convention-based router middleware that chooses controller based on its namespace and class name.
Requirements
- PHP 8.1 or higher.
Installation
The package could be installed with Composer:
General usage
-
Add
\Yiisoft\FileRouter\FileRouter
to the list of middlewares in your application configuration,web/params.php
: - Configure the file router for your needs.
Note:
FileRouter
goes after regularRouter
to serve as a fallback in case explicitly defined route is not found.
By default, the following structure of the app could be used assuming App
points to src
directory:
Here's how it works:
GET /
→IndexController::index()
GET /user
→UserController::index()
POST /user
→UserController::create()
GET /user/blog/view
→User/BlogController::view()
GET /user/profile
→User/Profile/IndexController::index()
Documentation
For additional information, check the following docs:
- Guide: Português - Brasil
- Internals
If you need help or have a question, the Yii Forum is a good place for that. You may also check out other Yii Community Resources.
License
The Yii File Router is free software. It is released under the terms of the BSD License.
Please see LICENSE
for more information.
Maintained by Yii Software.
Support the project
Follow updates
All versions of file-router with dependencies
ext-mbstring Version *
psr/http-message Version ^1.0|^2.0
psr/http-server-handler Version ^1.0
psr/http-server-middleware Version ^1.0
yiisoft/middleware-dispatcher Version ^5.2