Answer the question
In order to leave comments, you need to log in
How to convert url when submitting a form?
There is a link like site.ru/site/search?make=1&model=2 , with the help of my routing rules I was able to convert this link into this type site.ru/search/audi/a100 like everything is fine.
After I was happy I created a search form and then a problem appeared, when sending the get form with a request to the site.ru/site/search + get parameters selected by users in the make and model fields, I get the site.ru/site/search?make=1&model link =2 .
If I just paste the link like this, then I get what I need:
<a href="<?=Url::to(['/site/search', 'make' => 1, 'model' => 2])?>">
<form action="<?=Url::to(['/site/search'])?>" method="GET">
<select name="make">
<option value=1>Audi</option>
</select>
<select name="model">
<option value=2>A 100</option>
</select>
</form>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question