public function getFiltersForm($reset = false)
    {
        if (!$this->filtersForm || $reset) {
            if (empty($this->filters)) {
                return null;
            }

            $form = $this->factory->createNamedBuilder(
                'filter',
                FormType::class,
                null,
                [
                    'csrf_protection' => false,
                    'method' => 'GET',
                ]
            );

            /** @var DatagridFilter $filter */
            foreach ($this->filters as $filter) {
                $filter->buildForm($form);
            }

            $form->add(
                'submit',
                SubmitType::class,
                [
                    'label' => 'Filter',
                    'attr' => [
                        'class' =>'btn-success',
                    ]
                ]
            );

            $form->add(
                'reset',
                SubmitType::class,
                [
                    'label' => 'Reset'
                ]
            );

            $this->filtersForm = $form->getForm();
        }

        return $this->filtersForm;
    }
public function getFiltersForm($reset = false)
    {
        if (!$this->filtersForm || $reset) {
            if (empty($this->filters)) {
                return null;
            }

            $form = $this->factory->createNamedBuilder(
                'filter',
                FormType::class,
                null,
                [
                    'csrf_protection' => false,
                    'method' => 'GET',
                ]
            );

            /** @var DatagridFilter $filter */
            foreach ($this->filters as $filter) {
                $filter->buildForm($form);
            }

            $form->add(
                'submit',
                SubmitType::class,
                [
                    'label' => 'Filter',
                    'attr' => [
                        'class' =>'btn-success',
                    ]
                ]
            );

            $form->add(
                'reset',
                SubmitType::class,
                [
                    'label' => 'Reset'
                ]
            );

            $this->filtersForm = $form->getForm();
        }

        return $this->filtersForm;
    }
public function getFiltersForm ( $ reset = false ) { if ( ! $ this -> filtersForm || $ reset ) { if ( empty ( $ this -> filters ) ) { return null ; } $ form = $ this -> factory -> createNamedBuilder ( 'filter' , FormType :: class , null , [ 'csrf_protection' => false , 'method' => 'GET' , ] ) ; /** @var DatagridFilter $filter */ foreach ( $ this -> filters as $ filter ) { $ filter -> buildForm ( $ form ) ; } $ form -> add ( 'submit' , SubmitType :: class , [ 'label' => 'Filter' , 'attr' => [ 'class' => 'btn-success' , ] ] ) ; $ form -> add ( 'reset' , SubmitType :: class , [ 'label' => 'Reset' ] ) ; $ this -> filtersForm = $ form -> getForm ( ) ; } return $ this -> filtersForm ; }
Get the form used to filter the list of entities displayed in the datagrid

@param bool $reset Force rebuild ?
@return null | \Symfony\Component\Form\FormInterface
Get the form used to filter the list of entities displayed in the datagrid