G
G
Grigory Vasilkov2017-09-24 12:49:41
symfony
Grigory Vasilkov, 2017-09-24 12:49:41

How to make a route in Symfony that, in the case of a certain parameter, will remove it from the final URL?

I can't figure out how to do
$this->generateUrl('page_locale', [ 'lang' => 'en' ]); in this framework. to automatically remove en from the URL since it's the default language

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
BoShurik, 2017-09-24
@BoShurik

Apparently you need a custom router.
I threw an example on flex'e :
The router itself: Router
we replace the default one with our own: services.yaml

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question