PHPackages                             ice-cream/router - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. ice-cream/router

ActiveLibrary[HTTP &amp; Networking](/categories/http)

ice-cream/router
================

Ice Cream Router is meant to be the easiest router in the world. No Fuss, No Muss

1.0.3(8y ago)017MITPHPPHP &gt;=7.2.0

Since Aug 16Pushed 7y agoCompare

[ Source](https://github.com/AdamKyle/ice-cream-router)[ Packagist](https://packagist.org/packages/ice-cream/router)[ Docs](http://adambalan.com/)[ RSS](/packages/ice-cream-router/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (3)Dependencies (5)Versions (5)Used By (0)

Ice Cream Router
================

[](#ice-cream-router)

[![Build Status](https://camo.githubusercontent.com/1d4529c1bfb41ad04e77f46ef88723b2d44e43fd66f48c6f820524808cbfb150/68747470733a2f2f7472617669732d63692e6f72672f4164616d4b796c652f6963652d637265616d2d726f757465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/AdamKyle/ice-cream-router)[![Packagist](https://camo.githubusercontent.com/e3f8a5c8ffa5ffa03fb9293e414bd00128eb5a3a8d1c1f137fd731222d2560ef/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6963652d637265616d2f726f757465722e7376673f7374796c653d666c6174)](https://packagist.org/packages/ice-cream/router)![Made With Love](https://camo.githubusercontent.com/8e692b7ce6dc41cb29efb7aa471b6e72a0a009ff99bf93ca83023a3da4e177b8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d616465253230576974682d4c6f76652d677265656e2e737667)

- Requires PHP 7.2
- Is Standalone

This is a very thin and very basic wrapper around the concept of [symfony routing](http://symfony.com/doc/current/routing.html).

It's main goal is to be as simple and easy to use as possible with no bloat or fluff.

Documentation
-------------

[](#documentation)

Why is there no generated documentation, like the other Ice Cream packages?

Because PHP Documentor has a symfony config that conflicts with the symfony router.

How Do I Use It?
----------------

[](#how-do-i-use-it)

The simplest way to use this is:

```
use IceCreamRouter\Router;

$router = new Router();

$router->get('/foo/{id}', 'foo', function($id, $request, $response){
  return response->setContent('Id is: ' . $id);
});

$response = $router->processRoutes(Request::create('/foo/1', 'GET'));

var_dump($response->getContent()); // => Id is: 1
```

Could not get any simpler then that.

The same thing is done for `POST`, `PUT` and `DELETE` The only difference between whats above and what you would do for these methods is omitting `$response` as a variable for the closure.

```
use IceCreamRouter\Router;

$router = new Router();

$router->post('/foo/{id}', 'foo', function($id, $request){
  return new Response('the message passed in was: ' . $request->get('message') . ' and the id is: ' . $id);
});

$response = $router->processRoutes(Request::create('/foo/1', 'POST', ['message' => 'hello world']));

var_dump($response->getContent()); // => the message passed in was: hello world and the id is: 1
```

We are even smart enough, with the help of symfony, to recognize the same route with different methods:

```
use IceCreamRouter\Router;

$router = new Router();

$router->post('/foo/{id}', 'foo', function($id, $request){
  return new Response('the message passed in was: ' . $request->get('message') . ' and the id is: ' . $id);
});

$router->delete('/foo/{id}', 'foo_del', function($id, $request){
  return new Response('deleted');
});

$router->put('/foo/{id}', 'foo_put', function($id, $request){
  return new Response('the message put was: ' . $request->get('message') . ' and the id is: ' . $id);
});

$response = $router->processRoutes(Request::create('/foo/1', 'POST', ['message' => 'hello world']));

var_dump($response->getContent()); // => the message passed in was: hello world and the id is: 1
```

You can see here that we have the same end point, with different methods, as a result we can create a request that only does `POST` and it will match the correct endpoint.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~192 days

Total

4

Last Release

3027d ago

PHP version history (2 changes)1.0PHP &gt;=7.0.0

1.0.3PHP &gt;=7.2.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/188563?v=4)[AdamBalan](/maintainers/AdamKyle)[@AdamKyle](https://github.com/AdamKyle)

---

Top Contributors

[![AdamKyle](https://avatars.githubusercontent.com/u/188563?v=4)](https://github.com/AdamKyle "AdamKyle (14 commits)")

---

Tags

httphttpsrouterlibraryroutingrequest management

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ice-cream-router/health.svg)

```
[![Health](https://phpackages.com/badges/ice-cream-router/health.svg)](https://phpackages.com/packages/ice-cream-router)
```

###  Alternatives

[symfony/framework-bundle

Provides a tight integration between Symfony components and the Symfony full-stack framework

3.6k246.0M11.1k](/packages/symfony-framework-bundle)[api-platform/http-cache

API Platform HttpCache component

274.1M16](/packages/api-platform-http-cache)[miladrahimi/phprouter

A powerful, lightweight, and very fast HTTP URL router for PHP projects.

20633.5k2](/packages/miladrahimi-phprouter)[wilaak/radix-router

High-performance radix tree based HTTP request router

615.0k5](/packages/wilaak-radix-router)[elementaryframework/water-pipe

URL routing framework and requests/responses handler for PHP

254.9k4](/packages/elementaryframework-water-pipe)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
