Thursday, October 23, 2014

Re: Save many of the same model

I am using 2.4

On Thursday, 23 October 2014 14:11:36 UTC+5:30, aWebDeveloper wrote:
Basically user selects a section and adds all users to it. I used the form below

<?php echo $this->Form->input("SectionsUser.section_id"); ?>  <?php echo $this->Form->input("SectionsUser.user_id", array('multiple'=>'checkbox')); ?>      

Which generated 
Array  (      [section_id] => 1      [user_id] => Array          (              [0] => 3              [1] => 4          )    )

 How do i save it. I wish to save above data or suggest me a way to modify my form to generate data in the correct format. 

I know i can ;loop through this data n convert to saveAll format but is there a way to achieve same in a cakeohp way 


--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: