PHPackages                             darthpestilane/niceroute - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. darthpestilane/niceroute

ActiveLibrary[API Development](/categories/api)

darthpestilane/niceroute
========================

A simple and nice router for PHP

13PHP

Since Mar 22Pushed 7y ago1 watchersCompare

[ Source](https://github.com/DarthPestilane/niceroute)[ Packagist](https://packagist.org/packages/darthpestilane/niceroute)[ RSS](/packages/darthpestilane-niceroute/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

NiceRoute - A simple and nice router for PHP
============================================

[](#niceroute---a-simple-and-nice-router-for-php)

If you just want a minimal routing library for PHP instead of `laravel/lumen` or `slim` ...

Here you are!

Features
--------

[](#features)

- Http verb methods: `get` `post` `put` `patch` `delete`
- Placeholder in route pattern: `get /user/{user_id}/article/{article_id}`
- Request and Response based on Symfony
- Before/After Middleware supported
- Group routes supported

Requirement
-----------

[](#requirement)

- php: ^7.1.3

Installation
------------

[](#installation)

`composer require darthpestilane/niceroute`

Usage
-----

[](#usage)

There are some example code in `example` directory.

### Basic one

[](#basic-one)

We will registry all our routes in `\NiceRoute\Router` closure. Each route we are going to define, should be like `$route->get('pattern', function() {})`. We can use these methods to quickly define routes:

- get
- post
- put
- patch
- delete

Each method stands for the corresponding http method.

```
