I am using symfony and I want to get the url of a specific route
,
my route
is like this
project_sign_in:
pattern: /signin
defaults: { _controller: ProjectContactBundle:User:signIn }
i want to generate the url from this route so i can get
localhost/app_dev.php/signin
or {SERVER-ADDRESS}/app_dev/signin
if I was browsing the server.
Using the Routing Component at version 4.0:
<?php
use Symfony\Component\Routing\Generator\UrlGenerator;
UrlGenerator->generate('project_sign_in', [], UrlGenerator::ABSOLUTE_URL);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With