I have created a link on my app to allow users to create appointments, but need to pass some extra data across so the app knows which client to book the appointment to. How would I do this?
e.g. <li><?php echo $this->Html->link('Book Appointment', array('admin' => true, 'controller' => 'appointments', 'action' => 'add')); ?></li>
So the url would be something like: /admin/appointments/add?clientid=2
NOTE: If someone thinks this is a bad way to do this please also comment with alternate solutions etc. Thanks
I found this in the documentation: http://book.cakephp.org/view/1442/link
You can do the following:
The code is untested since I don’t have CakePHP installed and there was a long time since I used it. I’m sure you can get the example working by looking at the documentation aswell.