won't go into displays on a page with human-friendly URLs. So, I don't
want to have to use a URL that includes a numeric ID for the database
node I'm working on. I've run into two problems I find exceptionally
odd:
1. When creating the action for a form using the "action" element of
the options array, there is no way to specify that the URL should
include the identifier of the node you're working on. It's quite
common to have a url like /stuff/display/thisThing and update the
values for that node. Why does CakePHP not allow us to specify an
action like /display/thisThing?
2. Since that doesn't work, I'm using the 'url' element of the options
array. Implicitly, if I'm creating my own URL from whole cloth, I
certainly already know what I want that URL to be. But the Cake form
helper takes it upon itself to prepend the form with ID of the node.
By way of example: I am creating the form using the following code:
<?php echo $form->create(null, array('url' => array('controller' =>
'charts',
'action' => 'display',
$chart['Chart']['chartid']))); ?>
On first page load, the output form looks fine:
<form id="ChartAdminDisplayForm" method="post" action="/admin/charts/
display/BUD" accept-charset="iso-8859-1">
But after hitting the submit button, I get the following:
<form id="ChartAdminDisplayForm" method="post" action="/admin/charts/
display/8/BUD" accept-charset="iso-8859-1">
Can anybody tell me why this happens and if there is a way around it?
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
No comments:
Post a Comment