Use the injected Silex\Application instead of the Request

To avoid the error: 'Accessed request service outside of request scope. Try moving that call to a before handler or controller.'