routing - cakephp router change url and params -


i want use router.php change url ( in cakephp version 2.1.3):

currently, have url like:

    http://domain.com/register/add?username=123&fullname=abc 

now want change (rewrite) url new :

    http://domain.com/regis-new?cus_name=123&cus_full_name=abc 

my code in controller:

 class registercontroller extends appcontroller{     function index(){        $username = $this->request->query['username'];        $fullname = $this->request->query['fullname'];     }   } 

how can config router apply new url?

thanks

router::connect('/regis-new/*',     array(         'controller' => 'register'         'action' => 'add' // or new action name     ) ); 

when put start after alias means pass thing after alias.

the parameters doesn't have thing routing.

:) check input names in view. e.g. if input name "username" rename "cus_name"

echo $this->form->input('cus_name' array(      'name' => 'cus_name' )); 

make sure when input values new names. e.g. in action:

$this->request->data["cus_name"]; 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -