public function searchAction($plugin, $field, Request $request)
    {
        /* @var $refiller RefillerInterface */
        if (!($refiller = $this->get('anime_db.plugin.refiller')->getPlugin($plugin))) {
            throw $this->createNotFoundException('Plugin \''.$plugin.'\' is not found');
        }
        $item = $this->createForm('entity_item', new Item())
            ->handleRequest($request)
            ->getData();

        $result = [];
        if ($refiller->isCanSearch($item, $field)) {
            $result = $refiller->search($item, $field);
            /* @var $search_item ItemRefiller */
            foreach ($result as $key => $search_item) {
                $result[$key] = [
                    'name' => $search_item->getName(),
                    'image' => $search_item->getImage(),
                    'description' => $search_item->getDescription(),
                    'source' => $search_item->getSource(),
                    'link' => $this->generateUrl('refiller_search_fill', [
                        'plugin' => $plugin,
                        'field' => $field,
                        'id' => $item->getId(),
                        'data' => $search_item->getData(),
                        'source' => $search_item->getSource(),
                    ]),
                ];
            }
        }

        return $this->render('AnimeDbCatalogBundle:Refill:search.html.twig', [
            'result' => $result,
        ]);
    }
public function searchAction($plugin, $field, Request $request)
    {
        /* @var $refiller RefillerInterface */
        if (!($refiller = $this->get('anime_db.plugin.refiller')->getPlugin($plugin))) {
            throw $this->createNotFoundException('Plugin \''.$plugin.'\' is not found');
        }
        $item = $this->createForm('entity_item', new Item())
            ->handleRequest($request)
            ->getData();

        $result = [];
        if ($refiller->isCanSearch($item, $field)) {
            $result = $refiller->search($item, $field);
            /* @var $search_item ItemRefiller */
            foreach ($result as $key => $search_item) {
                $result[$key] = [
                    'name' => $search_item->getName(),
                    'image' => $search_item->getImage(),
                    'description' => $search_item->getDescription(),
                    'source' => $search_item->getSource(),
                    'link' => $this->generateUrl('refiller_search_fill', [
                        'plugin' => $plugin,
                        'field' => $field,
                        'id' => $item->getId(),
                        'data' => $search_item->getData(),
                        'source' => $search_item->getSource(),
                    ]),
                ];
            }
        }

        return $this->render('AnimeDbCatalogBundle:Refill:search.html.twig', [
            'result' => $result,
        ]);
    }
public function searchAction ( $ plugin , $ field , Request $ request ) { /* @var $refiller RefillerInterface */ if ( ! ( $ refiller = $ this -> get ( 'anime_db.plugin.refiller' ) -> getPlugin ( $ plugin ) ) ) { throw $ this -> createNotFoundException ( 'Plugin \'' . $ plugin . '\' is not found' ) ; } $ item = $ this -> createForm ( 'entity_item' , new Item ( ) ) -> handleRequest ( $ request ) -> getData ( ) ; $ result = [ ] ; if ( $ refiller -> isCanSearch ( $ item , $ field ) ) { $ result = $ refiller -> search ( $ item , $ field ) ; /* @var $search_item ItemRefiller */ foreach ( $ result as $ key => $ search_item ) { $ result [ $ key ] = [ 'name' => $ search_item -> getName ( ) , 'image' => $ search_item -> getImage ( ) , 'description' => $ search_item -> getDescription ( ) , 'source' => $ search_item -> getSource ( ) , 'link' => $ this -> generateUrl ( 'refiller_search_fill' , [ 'plugin' => $ plugin , 'field' => $ field , 'id' => $ item -> getId ( ) , 'data' => $ search_item -> getData ( ) , 'source' => $ search_item -> getSource ( ) , ] ) , ] ; } } return $ this -> render ( 'AnimeDbCatalogBundle:Refill:search.html.twig' , [ 'result' => $ result , ] ) ; }
Search for refill.

@param string $plugin
@param string $field
@param Request $request

@return Response
Search for refill .