I don’t understand what you are trying to do.
Would you please elaborate your problem a little bit more clearly?
What is your controller that you want to call? How do you define it as an action method? What parameter does that action accept? And where and how do you want to call it? I mean, from another controller or from a browser’s address bar?
$url = ‘/search/’+$(’#src_field’).val(); //any query string from user input field
$.get($url, //and so on
‘search/<src:\w+>’ => ‘category/search’,// here is a key point
when i enter one word in search field - all works fine
when two words (‘yii2 url’ for example) =
GET http://mysite/search/yii2%20url
yii\base\InvalidRouteException: Unable to resolve the request “search/yii2 url”. in M:\OSPanel\domains\mysite\vendor\yiisoft\yii2\base\Module.php:537