Slim middleware to attach controllers to routes