Z
Z
zirdya2018-07-04 00:36:55
symfony
zirdya, 2018-07-04 00:36:55

Slash in Symfony route?

Good evening!
There is a route

@Route("/{slug}/", name="my_page", requirements={"slug"=".+"})

but for some reason, when navigating to mysite.com/mypage/, the $slug variable contains "mypage/", i.e. slug along with a slash.
Why does symfony add a slash to a variable and how to get rid of it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
BoShurik, 2018-07-04
@zirdya

In 3.4
either
In 4.1 the desired result will be produced

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question