middleware = function (ctx, next) {
    return fn.call(this, ctx.params[param], ctx, next);
  }
Run validations on route named parameters.

@example

```javascript
router
  .param('user', function (id, ctx, next) {
    ctx.user = users[id];
    if (!user) return ctx.status = 404;
    next();
  })
  .get('/users/:user', function (ctx, next) {
    ctx.body = ctx.user;
  });
```

@param {String} param
@param {Function} middleware
@returns {Layer}
@private