From something that is ContainerAware (like a controller):
$request = $this->container->get('request');
$routeName = $request->get('_route');
More Related Contents:
- A YAML file cannot contain tabs as indentation
- Symfony2 Routing – route subdomains
- Why am I Facing with this problem when run symfony? [closed]
- Symfony3 ClassNotFoundException after bundle creation
- Automatic post-registration user authentication
- On delete cascade with doctrine2
- How to programmatically login/authenticate a user?
- SF2 form : error Neither the property … nor one of the methods “get
- Symfony2 – creating own vendor bundle – project and git strategy
- Passing data to buildForm() in Symfony 2.8, 3.0 and above
- Symfony2 AJAX Login
- How to display string that contains HTML in twig template?
- Accessing session from TWIG template
- The CSRF token is invalid. Please try to resubmit the form
- Access POST values in Symfony2 request object
- Symfony 2 EntityManager injection in service
- PHP Application URL Routing
- Symfony2: After successful login event, perform set of actions
- Symfony error The class XXX was not found in the chain configured namespaces XXX
- How to render a DateTime object in a Twig template
- Posting JSON objects to Symfony 2
- How to get the request parameters in Symfony 2?
- Symfony 2.0 getting service inside entity
- How to access service container in symfony2 global helper function (service)?
- How to force Doctrine to update array type fields?
- How to make form_rest() not display a field with Symfony2?
- Query on a many-to-many relationship using Doctrine with Symfony2
- Handling multiple file uploads in Sonata Admin Bundle
- How to render content from string/database with twig? [duplicate]
- Is there any sort of “pre login” event or similar?