Pergunta

I m new to cakephp, want to know how can i change url like this

C:/xyz.com/countries/view/5 to C:/xyz.com/countries/ABC

where 5 is id of ABC country

Thanks in Advance

Foi útil?

Solução

Router::connect('/countries/:country_id', array('controller' => 'countries', 'action' => 'view'), array('pass' => array('country_id')));

In the controller:

public function view() {
   $countryId =  $this->request->params['country_id'];
}
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top