bundle/Form/Builder/FormBuilder.php
public function createFormForLocation(Location $location, $useAjax = false)
    {
        $contentInfo = $location->contentInfo;

        $contentType = $this->contentTypeService->loadContentType($contentInfo->contentTypeId);

        $data = new DataWrapper(new InformationCollectionStruct(), $contentType, $location);

        $formBuilder = $this->formFactory
            ->createBuilder(
                Kernel::VERSION_ID < 20800 ?
                    'ezforms_information_collection' :
                    InformationCollectionType::class,
                $data,
                array(
                    'csrf_protection' => $this->useCsrf,
                )
            );

        if ($useAjax) {
            $formBuilder->setAction($this->router->generate('netgen_information_collection_handle_ajax', array('location' => $location->id)));
        }

        return $formBuilder;
    }
public function createFormForLocation(Location $location, $useAjax = false)
    {
        $contentInfo = $location->contentInfo;

        $contentType = $this->contentTypeService->loadContentType($contentInfo->contentTypeId);

        $data = new DataWrapper(new InformationCollectionStruct(), $contentType, $location);

        $formBuilder = $this->formFactory
            ->createBuilder(
                Kernel::VERSION_ID < 20800 ?
                    'ezforms_information_collection' :
                    InformationCollectionType::class,
                $data,
                array(
                    'csrf_protection' => $this->useCsrf,
                )
            );

        if ($useAjax) {
            $formBuilder->setAction($this->router->generate('netgen_information_collection_handle_ajax', array('location' => $location->id)));
        }

        return $formBuilder;
    }
public function createFormForLocation ( Location $ location , $ useAjax = false ) { $ contentInfo = $ location -> contentInfo ; $ contentType = $ this -> contentTypeService -> loadContentType ( $ contentInfo -> contentTypeId ) ; $ data = new DataWrapper ( new InformationCollectionStruct ( ) , $ contentType , $ location ) ; $ formBuilder = $ this -> formFactory -> createBuilder ( Kernel :: VERSION_ID < 20800 ? 'ezforms_information_collection' : InformationCollectionType :: class , $ data , array ( 'csrf_protection' => $ this -> useCsrf , ) ) ; if ( $ useAjax ) { $ formBuilder -> setAction ( $ this -> router -> generate ( 'netgen_information_collection_handle_ajax' , array ( 'location' => $ location -> id ) ) ) ; } return $ formBuilder ; }
Creates Information collection Form object for given Location object.

@param Location $location
@param bool $useAjax

@return FormBuilderInterface
Creates Information collection Form object for given Location object .