getkirby/toolkit — pull request #32 by dweidner (2014-11-18 16:57:18+00:00)
Title: Optional return value for route filter

Would be nice if the Router implementation would use a filters return value to determine whether the current route is valid or not. This way we could write our filters like this and only catch those cases where no route is returned:

```php
/**
* Capability Test
*
* @return boolean
*/
$this->router->filter('canEdit', function() use ($user, $cap) {
$roles = str::split($cap['edit'], '|');
return in_array('author', $roles) || ($user && call(array($user, 'hasRole'), $roles));
});
```