Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // $product
- $medias = array();
- foreach ($product->medias as $m) {
- $medias[] = $m->filename;
- }
- // in the post var, you will now have ['medias'][{filenames}]
- echo $zest->image_selector('medias', $medias,TRUE,FALSE);
- // then when posted you want to do:
- $medias = array();
- foreach ($_POST['medias'] as $m) {
- $medias[] = ORM::factory('media',$m)->id;
- }
- $product->medias = $medias;
- $product->save();
Add Comment
Please, Sign In to add comment