xuanyan/router
Composer 安装命令:
composer require xuanyan/router
包简介
README 文档
README
How to use it
require_once __DIR__ . '/src/Router.php'; use XuanYan\Router as Router; $router = new Router(__DIR__ . '/Controllers'); // set blog module // handle url like: http://example.com/blog/controller/action, it was a rewrite url $router->setModule('blog', __DIR__ . '/Blog/Controllers'); // map blog/xuanyan to blogdb/xuanyan $router->map('blog/:username', 'blogdb/:username'); // if u just want to handler the number you could use :NUM $router->map('user/:NUM/profile', 'user/profile/:NUM'); // run router // handle url like: http://example.com/?url=controller/action // sure, u can use rewrite to let the url seems better $router->run(@$_GET['url']);
统计信息
- 总下载量: 38
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2012-12-11