xuanyan/router 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

xuanyan/router

Composer 安装命令:

composer require xuanyan/router

包简介

README 文档

README

Build Status

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2012-12-11