public function fillerAction($plugin, Request $request)
    {
        /* @var $response Response */
        $response = $this->getCacheTimeKeeper()->getResponse();
        // response was not modified for this request
        if ($response->isNotModified($request)) {
            return $response;
        }

        /* @var $chain ChainFiller */
        $chain = $this->get('anime_db.plugin.filler');
        /* @var $filler FillerInterface */
        if (!($filler = $chain->getPlugin($plugin))) {
            throw $this->createNotFoundException('Plugin \''.$plugin.'\' is not found');
        }

        /* @var $form Form */
        $form = $this->createForm($filler->getForm());

        $fill_form = null;
        $form->handleRequest($request);
        if ($form->isValid()) {
            $item = $filler->fill($form->getData());
            if (!($item instanceof Item)) {
                $form->addError(new FormError('Can`t get content from the specified source'));
            } else {
                $fill_form = $this->createForm('entity_item', $item)->createView();
            }
        }

        return $this->render('AnimeDbCatalogBundle:Fill:filler.html.twig', [
            'plugin' => $plugin,
            'plugin_name' => $filler->getTitle(),
            'form' => $form->createView(),
            'fill_form' => $fill_form,
        ], $response);
    }
public function fillerAction($plugin, Request $request)
    {
        /* @var $response Response */
        $response = $this->getCacheTimeKeeper()->getResponse();
        // response was not modified for this request
        if ($response->isNotModified($request)) {
            return $response;
        }

        /* @var $chain ChainFiller */
        $chain = $this->get('anime_db.plugin.filler');
        /* @var $filler FillerInterface */
        if (!($filler = $chain->getPlugin($plugin))) {
            throw $this->createNotFoundException('Plugin \''.$plugin.'\' is not found');
        }

        /* @var $form Form */
        $form = $this->createForm($filler->getForm());

        $fill_form = null;
        $form->handleRequest($request);
        if ($form->isValid()) {
            $item = $filler->fill($form->getData());
            if (!($item instanceof Item)) {
                $form->addError(new FormError('Can`t get content from the specified source'));
            } else {
                $fill_form = $this->createForm('entity_item', $item)->createView();
            }
        }

        return $this->render('AnimeDbCatalogBundle:Fill:filler.html.twig', [
            'plugin' => $plugin,
            'plugin_name' => $filler->getTitle(),
            'form' => $form->createView(),
            'fill_form' => $fill_form,
        ], $response);
    }
public function fillerAction ( $ plugin , Request $ request ) { /* @var $response Response */ $ response = $ this -> getCacheTimeKeeper ( ) -> getResponse ( ) ; // response was not modified for this request if ( $ response -> isNotModified ( $ request ) ) { return $ response ; } /* @var $chain ChainFiller */ $ chain = $ this -> get ( 'anime_db.plugin.filler' ) ; /* @var $filler FillerInterface */ if ( ! ( $ filler = $ chain -> getPlugin ( $ plugin ) ) ) { throw $ this -> createNotFoundException ( 'Plugin \'' . $ plugin . '\' is not found' ) ; } /* @var $form Form */ $ form = $ this -> createForm ( $ filler -> getForm ( ) ) ; $ fill_form = null ; $ form -> handleRequest ( $ request ) ; if ( $ form -> isValid ( ) ) { $ item = $ filler -> fill ( $ form -> getData ( ) ) ; if ( ! ( $ item instanceof Item ) ) { $ form -> addError ( new FormError ( 'Can`t get content from the specified source' ) ) ; } else { $ fill_form = $ this -> createForm ( 'entity_item' , $ item ) -> createView ( ) ; } } return $ this -> render ( 'AnimeDbCatalogBundle:Fill:filler.html.twig' , [ 'plugin' => $ plugin , 'plugin_name' => $ filler -> getTitle ( ) , 'form' => $ form -> createView ( ) , 'fill_form' => $ fill_form , ] , $ response ) ; }
Create new item from source fill.

@param string $plugin
@param Request $request

@return Response
Create new item from source fill .