C
C
cat_crash2014-02-17 16:33:22
Yii
cat_crash, 2014-02-17 16:33:22

How can I get all the parameters passed to the controller as an array?

Good day.
There is a wonderful thing in Yii - Beautiful URLs that I want to install. But there is a problem. Previously, all filtering parameters for me came via GET, and to simplify the work, I did something like this in the View (simplified for clarity):

foreach(....){
$_GET['filter']=$value;
$link=$this->createUrl('models/showModels',$_GET);
echo CHtml::link(Yii::t('main',$value),$link);
}

With the transition to CNC, the $_GET array has become always empty. Accordingly, the question is - how can you get all the parameters passed to the controller as an array, just like they were in _GET ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Max, 2014-02-17
@AloneCoder

Out of the box, this is not possible, you need to use named parameters, but you can override the construction rules. Examples are in the documentation yiiframework.ru/doc/guide/ru/topics.url

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question