V
V
Vlad Osadchyi2018-11-12 22:08:23
Yii
Vlad Osadchyi, 2018-11-12 22:08:23

How to properly configure routing in Yii2?

I know that there are already a bunch of such topics, but I still could not find a solution to my situation.
In general, I need to make the address site.ru/carlead to the baseController controller, and carbe passed to the controller via GET, GET[type=car], and
site.ru/car/create----> baseController actionCreate GET[type=car],
but such rules should only work for addresses site.ru/car/...andsite.ru/bike/...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2018-11-12
@VladOsadchyi

Good evening.
You can try to do in the urlManager rules like this
But, most likely, you will need to write a custom UrlManager class in which to define all your rules. This topic is separate, I can only give an approximate example and links for study.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question