How to create a beautiful address when using forms?

that's actually form

<?php $form=ActiveForm::begin(['action'=-->Yii::$app->urlManager->createUrl(['/serial/category/search']),'method'=>'get']); ?>
 <?= Html::textInput('query',",['placeholder'=-->'Search']) ?>
 <div class="form-group">
 <?= Html::submitButton('<i class="fa fa-search"-->') ?>
</div>
 <?php $form=ActiveForm::end(); ?>


so try to catch it in urlManager rules.

'/serial/category/search/<query>' => '/serial/category/search',
 '/serial/category/search/<query:\w*>' => '/serial/category/search',
 '<module:serial>/<controller:category>/<action:searh>/<query>' => '<module>/<controller>/<action>',
 '<module:serial>/<controller:category>/<action:searh>/<query:\w*>' => '<module>/<controller>/<action>',
 '<module:\w+>/<controller:\w+>/<action:(\w|-)+>/<query>' => '<module>/<controller>/<action>',
 '<module:\w+>/<controller:\w+>/<action:(\w|-)+>/<query:\w*>' => '<module>/<controller>/<action>',
 '<module:\w+>/<controller:\w+>/<action:(\w|-)+>' => '<module>/<controller>/<action>',</action></controller></module></action:(\w|-)+></controller:\w+></module:\w+></action></controller></module></query:\w*></action:(\w|-)+></controller:\w+></module:\w+></action></controller></module></query></action:(\w|-)+></controller:\w+></module:\w+></action></controller></module></query:\w*></action:searh></controller:category></module:serial></action></controller></module></query></action:searh></controller:category></module:serial></query:\w*></query>


the only rule is triggered the rule accordingly comes to a string

http://site.com/serial/category/search?query=Запрос


All these body movements in order to obtain such a plan request http://site.com/serial/category/search/Запрос where I am blunt and not tell me ?
July 9th 19 at 10:35
1 answer
July 9th 19 at 10:37
Out of shape is better to do the POST and then redirect to the correct URL.
A form to do JS to immediately when you click redirecting the correct URL

Find more questions by tags Yii