I need the full path to a action inside my controller, to send it via email. How can I achieve something like {{ path('_route') }}
from inside my controller but the full path?
Symfony2: Full path to action/route in a controller
controllersymfony
Related Topic
- C# – RedirectToAction with parameter
- Java – Downloading a file from spring controllers
- C# – Multiple types were found that match the controller named ‘Home’
- Php – How to get the server path to the web directory in Symfony2 from inside the controller
- Symfony – Send email outside Controller Action in Symfony2
- Php – How to access a different controller from inside a controller Symfony2
- Symfony – How to update a single library with Composer
- C# – Get controller and action name from within controller
Best Answer
Juan's answer is right if you want the local path. The absolute path — which is helpful to be send through email — needs extra parameter(s):
The third parameter indicates that the absolute path is to be generated.
If you want to use this URL in your view just add the
$url
to the response array in your action and use it.