codeguy/Slim — pull request #497 by gmanricks (2013-04-02 08:51:52+00:00)
Title: New Feature - Route Groups

# Route Groups

This pull-request adds the ability to declare route groups. It accepts the same parameters as the route functions do (i.e. pattern, mw1, mw2, etc... callable), and will work with placeholders in the pattern.

## Usage

#### Basic Use

```php
$app->group('/v1.0/', $mw, function () use ($app) {
$app->get('/users', function() {
echo "This is a route for '/v1.0/users';
}
});
```

#### Using Placeholders

```php
$app->group('/users/:name', function () use ($app) {
$app->get('/posts/:id', function ($name, $id) {
echo "Showing post id #" . $id . " for user " . $name;
});
});
```