public function addAction(Request $request)
    {
        $storage = new Storage();

        /* @var $form Form */
        $form = $this->createForm(new StorageForm(), $storage);

        if ($request->getMethod() == 'POST') {
            $form->handleRequest($request);
            if ($form->isValid()) {
                $em = $this->getDoctrine()->getManager();
                $em->persist($storage);
                $em->flush();

                return $this->redirect($this->generateUrl('storage_list'));
            }
        }

        return $this->render('AnimeDbCatalogBundle:Storage:add.html.twig', [
            'form' => $form->createView(),
            'guide' => $this->get('anime_db.api.client')->getSiteUrl(self::GUIDE_LINK),
        ]);
    }
public function addAction(Request $request)
    {
        $storage = new Storage();

        /* @var $form Form */
        $form = $this->createForm(new StorageForm(), $storage);

        if ($request->getMethod() == 'POST') {
            $form->handleRequest($request);
            if ($form->isValid()) {
                $em = $this->getDoctrine()->getManager();
                $em->persist($storage);
                $em->flush();

                return $this->redirect($this->generateUrl('storage_list'));
            }
        }

        return $this->render('AnimeDbCatalogBundle:Storage:add.html.twig', [
            'form' => $form->createView(),
            'guide' => $this->get('anime_db.api.client')->getSiteUrl(self::GUIDE_LINK),
        ]);
    }
public function addAction ( Request $ request ) { $ storage = new Storage ( ) ; /* @var $form Form */ $ form = $ this -> createForm ( new StorageForm ( ) , $ storage ) ; if ( $ request -> getMethod ( ) == 'POST' ) { $ form -> handleRequest ( $ request ) ; if ( $ form -> isValid ( ) ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ em -> persist ( $ storage ) ; $ em -> flush ( ) ; return $ this -> redirect ( $ this -> generateUrl ( 'storage_list' ) ) ; } } return $ this -> render ( 'AnimeDbCatalogBundle:Storage:add.html.twig' , [ 'form' => $ form -> createView ( ) , 'guide' => $ this -> get ( 'anime_db.api.client' ) -> getSiteUrl ( self :: GUIDE_LINK ) , ] ) ; }
Add storage.

@param Request $request

@return Response
Add storage .