How can I create a URL for a Yii form with existing model parameters in a URL?
For example, I have one $modelwith some attributes and I want to get the URL like this:
$model
controller/formaction?Form%5Battr1%5D=VAL1&Form%5Battr2%5D=VAL2
Unable to configure URL when using the GET method. When you use the GET method, the browser is always united nameand valueall entrances to your line of action form. Therefore, it cannot be changed. One possible solution for getting ugly URLs is to use POST instead of GET.
name
value
You can create such URLs as follows:
Yii::app()->createUrl('controller/formaction', [ CHtml::activeName('Form', 'attr1') => 'VAL1', CHtml::activeName('Form', 'attr2') => 'VAL2', ]);
Have you tried something like this:
public function action formaction(){ $form = Yii::app()->request->getQuery('Form',false); }