src/Flowcode/ShopBundle/Controller/AdminProductController.php
/**
     * Displays a form to create a new Gallery entity.
     *
     * @Route("/{id}/bulkImages", name="admin_product_bulk_images")
     * @Method("GET")
     * @Template()
     */
Displays a form to create a new Gallery entity.
Displays a form to create a new Gallery entity .
public function bulkImagesAction(Product $product)
    {
        $gallery = $product->getMediaGallery();
        $entity = new GalleryItem();
        $entity->setGallery($gallery);
        $position = $gallery->getGalleryItems()->count();
        $entity->setPosition($position);
        $form = $this->createForm($this->get("amulen.shop.form.product.gallery"), $entity, array(
            'action' => $this->generateUrl('admin_product_gallery_item_create', array('id' => $product->getId())),
            'method' => 'POST',
        ));
        $form->add('submit', 'submit', array('label' => 'Create'));
        return array(
            'entity' => $entity,
            'product' => $product,
            'form' => $form->createView(),
        );
    }
public function bulkImagesAction ( Product $ product ) { $ gallery = $ product -> getMediaGallery ( ) ; $ entity = new GalleryItem ( ) ; $ entity -> setGallery ( $ gallery ) ; $ position = $ gallery -> getGalleryItems ( ) -> count ( ) ; $ entity -> setPosition ( $ position ) ; $ form = $ this -> createForm ( $ this -> get ( " amulen.shop.form.product.gallery " ) , $ entity , array ( 'action' => $ this -> generateUrl ( 'admin_product_gallery_item_create' , array ( 'id' => $ product -> getId ( ) ) ) , 'method' => 'POST' , ) ) ; $ form -> add ( 'submit' , 'submit' , array ( 'label' => 'Create' ) ) ; return array ( 'entity' => $ entity , 'product' => $ product , 'form' => $ form -> createView ( ) , ) ; }
Displays a form to create a new Gallery entity.
Displays a form to create a new Gallery entity .