liamato/ligght
最新稳定版本:1.0.1
Composer 安装命令:
composer require liamato/ligght
包简介
The simple PHP router
README 文档
README
#ligght ###The simple PHP router
ligght is a PHP micro router that helps you to easily route your HTTP Requests. ligght is the easiest and fastest way to create an API.
##Features
- Standard HTTP Methods
- GET
- POST
- PUT
- DELETE
- PATCH
- OPTIONS
- HEAD
- DEBUG
- Custom HTTP Methods using
\ligght\Interfaces\HttpMethodinterface - Parameter routing
##Getting Started
###Required
- PHP >= 5.3.*
- Apache
mod_rewrite
###Configure evironment
You must include that snippet in .htaccess file:
Options -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* index.php?$0 [PT,L]
Or copy this .htaccess file to the same folder of your index.php
###Hello World Tutorial
Set a route like this:
\ligght\Router::getInstance()->route( \ligght\Router::GET, '/hello/:name', function($name){ print "Hello, $name"; }, array(':name') );
And run the router:
\ligght\Router::getInstance()->run();
####Style Guide
Full coded with PSR-2 Coding Style
统计信息
- 总下载量: 25
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2015-01-10