Created
February 10, 2011 14:39
-
-
Save sydlawrence/820615 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// $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(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Checkout modules/zest_core/libraries/Zest_admin.php