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

## as a sequence to this [pull request](https://github.com/codeguy/Slim/pull/660)

### 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);
});

});
```