Skip to content

Instantly share code, notes, and snippets.

@sydlawrence
Created February 10, 2011 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sydlawrence/820615 to your computer and use it in GitHub Desktop.
Save sydlawrence/820615 to your computer and use it in GitHub Desktop.
// $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();
@sydlawrence
Copy link
Author

Checkout modules/zest_core/libraries/Zest_admin.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment