How to give container as argument to services

It’s easy, if service extends ContainerAware use \Symfony\Component\DependencyInjection\ContainerAware; class YouService extends ContainerAware { public function someMethod() { $this->container->get(‘router’)->generate(‘fos_user_profile_edit’) … } } service.yml your.service: class: App\…\YouService calls: – [ setContainer,[ @service_container ] ]

How does the login check_path route work without default controller/action?

The check_path route/path is used by your firewall to catch login requests. This route’s action is never really accessed. It’s the route/url your login form posts to and the request should be processed by your firewall’s provider service. If the check_path route’s action is being executed there is something wrong with the firewall (the request … Read more