Pass dynamic value in URL with CakePHP
- by Renato Dinhani Conceição
I have the following method that performs an Ajax request passing some dynamic value obtained from a select input.
It works fine, but the dynamic value is passed as parameter in the URL, something like states/listCities/?big_string_of_serialized_parameter .
$this->Js->event(
'change',
$this->Js->request(
array( #url
'controller' => 'states',
'action' => 'listCities'),
array( # ajax options that generates the serialized parameter
'update' => '#DealerCityId',
'data' => '$("#DealerStateId").serialize()',
'dataExpression' => true
)
)
);
I'm trying to do this in a more friendly URL way, something like states/listCities/2.
It's possible in CakePHP to generate a friendly URL like this with dynamic value from a input or is only possible passing the dynamic values as parameters?