Sunday, August 30, 2009

Re: Array of input text

You may want to check the naming of your fields ... if you plan to use
the saveAll() method they need to be as follows:

echo $form->input('Blogurl.0.url', array('label' => 'Other URL'));
echo $form->input('Blogurl.1.url', array('label' => 'Other URL'));
echo $form->input('Blogurl.2.url', array('label' => 'Other URL'));

which will create the required data array of

Array
(
[Blogurls] => Array(
[0] => Array
(
[url] => http://www.url1.com
)
[1] => Array
(
[url] => http://www.url2.com
)
)
)

See:http://book.cakephp.org/view/75/Saving-Your-Data
--~--~---------~--~----~------------~-------~--~----~
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: