protected function renderAdminForm(
        FormInterface $form,
        array $params = array(),
        $response = null,
        $template = self::TEMPLATE
    ){
        if (is_null($response)) {
            $code = Response::HTTP_OK;
            if ($form->isSubmitted() && !$form->isValid()) {
                $code = Response::HTTP_UNPROCESSABLE_ENTITY;
            }
            $response = new Response('', $code, array('Content-type' => 'text/html; charset=utf-8'));
        }

        $params = array_merge($params, array('form' => $form->createView()));

        return $this->render($template, $params, $response);
    }
protected function renderAdminForm(
        FormInterface $form,
        array $params = array(),
        $response = null,
        $template = self::TEMPLATE
    ){
        if (is_null($response)) {
            $code = Response::HTTP_OK;
            if ($form->isSubmitted() && !$form->isValid()) {
                $code = Response::HTTP_UNPROCESSABLE_ENTITY;
            }
            $response = new Response('', $code, array('Content-type' => 'text/html; charset=utf-8'));
        }

        $params = array_merge($params, array('form' => $form->createView()));

        return $this->render($template, $params, $response);
    }
protected function renderAdminForm ( FormInterface $ form , array $ params = array ( ) , $ response = null , $ template = self :: TEMPLATE ) { if ( is_null ( $ response ) ) { $ code = Response :: HTTP_OK ; if ( $ form -> isSubmitted ( ) && ! $ form -> isValid ( ) ) { $ code = Response :: HTTP_UNPROCESSABLE_ENTITY ; } $ response = new Response ( '' , $ code , array ( 'Content-type' => 'text/html; charset=utf-8' ) ) ; } $ params = array_merge ( $ params , array ( 'form' => $ form -> createView ( ) ) ) ; return $ this -> render ( $ template , $ params , $ response ) ; }
Render admin form and tag response with status 400 if form is badly completed

@param FormInterface $form
@param array         $params additional view parameters
@param Response|null $response
@param string        $template

@return Response
Render admin form and tag response with status 400 if form is badly completed