alineisi/router
Composer 安装命令:
composer require alineisi/router
包简介
this package is used to implement routing system with a lot of cool features !!!
README 文档
README
Routing system for PHP
Requries PHP >= 7.0
Installation
composer require alineisi/router
To get started
require_once __DIR__ . '/vendor/autoload.php';use Alineisi\Route;
be sure adding
Route::dispatch();
end of index.php
Usage
ex.1
Route::get('/', function () {return 'Hello World';});
ex.2
Route::get('/', [HomeController::class, 'index']);
ex.3
Route::post('/submit', function () {return $_POST['name'];});
Features
you can set not found page by using
Route::notFoundPath($path);
set named routes by using name method after routing, for example:
Route::get('/', function () {return 'Hello World';})->name('index');
and to use it:
\Alineisi\routeName('index');
you can also returning views by using
Route::view('/', 'index');
or
Route::view('/', 'index.php');
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-04-28