The solution I end up with is often writing my own <form> and </form> tags instead of using $form->create() and $form->end(). The issue with using custom form tags is that CakePHP will no longer auto fill input fields meaning that a lot of code has to be implemented to detect and specify input values. Overcoming this is quite simple and simply requires the use of $form->end() with a custom form tag, such that your form code looks like:
<form action="" method="POST">
<?= $form->input("User.name") ?>
<?= $form->input("User.email") ?>
<?= $form->end() ?>
2 comments:
Check this out:
echo $form->create('Post',array('type'=>'get', 'controller'=>'posts', 'action'=>'search'));
It's incredibly bad practice to submit a form to '' in any case, you should always specify your action, even if it IS to the same url that the form is located at ;o)
Post a Comment