Page 171 of 211,269, showing 20 records out of 4,225,379 total, starting on record 3,401, ending on 3,420
# | Username | Text | |
---|---|---|---|
# | Aug 7th 2008, 13:31 | jaredhoyt | $this->data = $this->Model->find() |
# | Aug 7th 2008, 13:31 | jaredhoyt | or read() or whatever |
# | Aug 7th 2008, 13:31 | jaredhoyt | if you want form inputs to automatically load db data |
# | Aug 7th 2008, 13:32 | beatzombies | jaredhoyt: oh, i see |
# | Aug 7th 2008, 13:32 | beatzombies | jaredhoyt: i am kind of making my own array of values from various models in my controller and setting that for my view to use |
# | Aug 7th 2008, 13:32 | jaredhoyt | if you just want to display data in text form, then do $this->set('some_var', $this->Model->find()) |
# | Aug 7th 2008, 13:32 | beatzombies | jaredhoyt: is that the wrong way to do things? |
# | Aug 7th 2008, 13:32 | jaredhoyt | beatzombies: then you're going to have to manually set the checkbox value |
# | Aug 7th 2008, 13:33 | beatzombies | jaredhoyt: and then manually set the values in the database when im updated those values? |
# | Aug 7th 2008, 13:33 | jaredhoyt | beatzombies: well, save them as you would any other form data |
# | Aug 7th 2008, 13:35 | jaredhoyt | if you're setting db data into a view var, then you'd do something like <?php echo $form->checkbox('Model.fieldname', array('value' => $view_var['path_to_field']); ?> |
# | Aug 7th 2008, 13:35 | beatzombies | jaredhoyt: so when i submit i wouldnt be able to just do a save() because the submitted data to the controller would not be model information |
# | Aug 7th 2008, 13:35 | beatzombies | i see |
# | Aug 7th 2008, 13:35 | jaredhoyt | beatzombies: when you hit submit, only form data is passed into the controller action |
# | Aug 7th 2008, 13:35 | jaredhoyt | you're view variables are lost ;) |
# | Aug 7th 2008, 13:36 | beatzombies | jaredhoyt: alright, i see i need to think about this some more |
# | Aug 7th 2008, 13:36 | beatzombies | jaredhoyt: thanks, ill definitely be back with more questions |
# | Aug 7th 2008, 13:37 | beatzombies | jaredhoyt: wait, so when i reference ContributorsItem as in $form->checkbox('ContributorsItem.contributed'); what does cakephp look at to get that value? |
# | Aug 7th 2008, 13:39 | foxmask | ? |
# | Aug 7th 2008, 13:39 | foxmask | hm |