bookfrank/viaduct
Composer 安装命令:
composer require bookfrank/viaduct
包简介
Viaduct is a very simple php router, hope to be able to help the php-framework beginners to understand the principle of router better
README 文档
README
Viaduct is a simple but quick PHP router.
Viaduct is a very simple php router, hope to be able to help the php-framework beginners to understand the principle of router better.
Features
- Simple
- One-file (only 6 functions)
- Laravel-like routes
Installation
- You can directly run
composer requireto install in your project.
composer require bookfrank/viaduct
- Also you can get the viaduct simply require it in your
composer.jsonfile.
"bookfrank/viaduct": "dev-master"
You will then need to run composer install to download it and have the autoloader updated.
Usage
First, create the routes.php file.
<?php use \Bookfrank\Viaduct\Router; Router::get('hello', function(){ echo "Hello viaduct"; }); Router::get('profile/{uid}', function($uid){ echo "Present userid is ".$uid; }); Router::get('blog/{id}', "\Foo\Bar\FooController@bar"); Router::dispatch();
<?php class FooController{ public function bar($id){ echo "id is ".$id; } }
Contact me
Author: Frank 李扬
Email: bookfrank@foxmail.com
统计信息
- 总下载量: 51
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-02-04