public function getForm($options = array())
    {
        $options['csrf_protection'] = false;

        $parameters = $this->getParameters();
        // If symfony version is >=2.8 then we use the FQCN for form types
        // Else we use the IDs.
        if (method_exists('Symfony\Component\Form\AbstractType', 'getBlockPrefix')) {
            $builder = $this->factory->createNamedBuilder(
                '',
                'Symfony\Component\Form\Extension\Core\Type\FormType',
                $parameters,
                $options
            );
            foreach ($parameters as $key => $value) {
                $builder->add($key, 'Symfony\Component\Form\Extension\Core\Type\HiddenType');
            }
        } else {
            $builder = $this->factory->createNamedBuilder('', 'form', $parameters, $options);
            foreach ($parameters as $key => $value) {
                $builder->add($key, 'hidden');
            }
        }

        return $builder->getForm();
    }
public function getForm($options = array())
    {
        $options['csrf_protection'] = false;

        $parameters = $this->getParameters();
        // If symfony version is >=2.8 then we use the FQCN for form types
        // Else we use the IDs.
        if (method_exists('Symfony\Component\Form\AbstractType', 'getBlockPrefix')) {
            $builder = $this->factory->createNamedBuilder(
                '',
                'Symfony\Component\Form\Extension\Core\Type\FormType',
                $parameters,
                $options
            );
            foreach ($parameters as $key => $value) {
                $builder->add($key, 'Symfony\Component\Form\Extension\Core\Type\HiddenType');
            }
        } else {
            $builder = $this->factory->createNamedBuilder('', 'form', $parameters, $options);
            foreach ($parameters as $key => $value) {
                $builder->add($key, 'hidden');
            }
        }

        return $builder->getForm();
    }
public function getForm ( $ options = array ( ) ) { $ options [ 'csrf_protection' ] = false ; $ parameters = $ this -> getParameters ( ) ; // If symfony version is >=2.8 then we use the FQCN for form types // Else we use the IDs. if ( method_exists ( 'Symfony\Component\Form\AbstractType' , 'getBlockPrefix' ) ) { $ builder = $ this -> factory -> createNamedBuilder ( '' , 'Symfony\Component\Form\Extension\Core\Type\FormType' , $ parameters , $ options ) ; foreach ( $ parameters as $ key => $ value ) { $ builder -> add ( $ key , 'Symfony\Component\Form\Extension\Core\Type\HiddenType' ) ; } } else { $ builder = $ this -> factory -> createNamedBuilder ( '' , 'form' , $ parameters , $ options ) ; foreach ( $ parameters as $ key => $ value ) { $ builder -> add ( $ key , 'hidden' ) ; } } return $ builder -> getForm ( ) ; }
Returns a form with defined parameters.

@param  array $options

@return Form
Returns a form with defined parameters .