Form Submit Get Params as path

Is it possible to convert passed GET params format when form submit. I mean when i press submit button the url looks like this site.com/controller/action?param1=value&param2=value when it should look like this site.com/controller/action/param1/value/param2/value. Url manager param urlFormat is set to path. Tried to achieve this by passing appendParams parameter, but first docs say that it set to TRUE by default, and second it didn’t help.


'urlManager'=>array(

			'class'=>'UrlManagerEx',

			'urlFormat'=>'path',

			'showScriptName'=>false,

			'appendParams' => true,

)

If you will have any questions, will reply as soon as possible. Thanks in advance.

If you wish to modify the way urls are seen, yes, you have to go to URL MANAGER, and change their aliases but… for a FORM? If you dont wish to show the parameters like that, I recommend you to use POST instead of GET, otherwise you have to do modify the rules (http://www.yiiframework.com/doc/guide/1.1/en/topics.url#user-friendly-urls) to suit those parameters of your form… not good

So you are saying that the only way to make this work - apply rules? I actually use rules, but not the simple ones, i use classes for different cases, so in parseUrl i should rework this params myself(using $request i suppose)?

I mean that the URL aliases for a form need to be ‘aliased’ if you wish to use that format… otherwise, the application will path encode those values that do know by your rules and attach the rest of the ‘unkown’ values as parameters to the string. I do not recommend you to do that for a form, why don’t you use POST instead if you don’t wish to see the extras parameters in the url?

Cheers

Then how the url parameters should be written? The code below is what I have and what I want is to have an url like “<webroot>/search/something” after submitting the form. I would like to stick with get method :huh:

What I get with my code is "<webroot>/apartment/search?query=something"


rules'=>array(

	'search/<query>' => 'apartment/search',

),


$form = $this->beginWidget('ActiveForm', array(

	'enableClientValidation' => true,

	'method' => 'get',

	'action' => $this->createUrl('apartment/search'),

	'clientOptions' => array('validateOnSubmit' => true),

));

		

echo $form->textField($model, 'query', array('placeholder' => 'Gdje putujete?', 'name' => 'query'));

echo CHtml::submitButton('▶', array('name' => null));

		

$this->endWidget();