Answer the question
In order to leave comments, you need to log in
How to organize mixed URL in YII?
I want to get such a URL
site.ru/catalog/list?sort= "name"&dir="DESC"
That is, so that the main url (with the controller and action) is CNC, and additional parameters are passed after the question mark.
I write like this:
$this->createUrl('catalog/list', array(
'id' => $this->cat_id,
'sort_type' => $this->sort_type,
'direction_type' => $this->direction_type,
));
http://guard.ru/catalog/id/17/sort_type/price/direction_type/DESC
Answer the question
In order to leave comments, you need to log in
You need to add a rule with a named parameter id to the routing.
Then id will be part of the URL, and the rest of the arguments will become GET parameters. The output will be:/catalog/17?sort_type=name&direction_type=DESC
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question