codeguy/Slim — pull request #660 by IlanFrumer (2013-10-25 07:58:25+00:00)
Title: Refer to $app as  $this inside a router

### Instead of repeating the keyword $use everywhere like that....

```php
$app = new \Slim\Slim();

$app->get('/',function () use ($app) {

});

$app->group('/api',function () use ($app) {

$app->get('/',function () use ($app) {

});

});
```

### We can just use $this:

```php
$app = new \Slim\Slim();

$app->get('/',function () {

});

$app->group('/api',function () {

$this->get('/',function () {
$this->halt(404);
});

});
```