I want to add a new custom action to my controller to get to a view of
a linked model and fill some data to be ready to use when view is
shown.
I have a model called requests containig customer requets.
I also have a model called bookings that is linked to requests and so
to cusotmers, too.
No I want to have a doBooking button in my index of all requests to
call the booking/add with filling the customer_id and request:id by
the doBooking button autmatically instead of choosig from dropdown in
the booking/add window.
In requests_controller I did add a funciton called doBooking($id)
[::code::]
function doBooking($id = null) {
if (!$id) {
$this->Session->setFlash(sprintf(__('Invalid %s', true),
'request'));
$this->redirect(array('action' => 'index'));
}
// -=-=> here i want to pass data to next model and call the
add view with perfilled form
}
[/::code::]
And also in the index.cpt for requests I did add a line to have the
button ready to use.
[::code::]
<?php echo $this->Html->link(__('doBooking', true), array('action' =>
'doBooking', $request['Request']['id'])); ?>
[/::code::]
Here I need some help please....
1st how to redirect to the add function calling the myapp/booking/add
inside doBooking
2nd how to pass the id of the request towards the add bokking windows
3rd how to get the data from request and data to fill up the booking/
add form
Any help is welcome (beginner in cakephp here so l´please be gentle
telling me what and why to do ;)
Thanks in advance
Michael
ps: cake 1.3rc1 here
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
To unsubscribe, reply using "remove me" as the subject.
No comments:
Post a Comment