无法使用symfony处理表单

I have controller, which render a form which is rendered to every page.

The problem is, that the form doesn't care about submit event.

Every page extends base.html.twig in which is

{{ render(controller('AppBundle:NewsLetter:formRender')) }}

This is the controller:

<?php

namespace AppBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;

use AppBundle\Entity\Emails;

use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;

class NewsLetterController extends Controller
{

    public function formRenderAction(Request $request)
    {
        $email = new Emails();

        $form = $this->createFormBuilder($email)
            ->add('email', EmailType::class, array('label' => false, 'attr' => array('placeholder' => 'Your e-mail address')))
            ->add('save', SubmitType::class, array('label' => 'SUBMIT!'))
            ->getForm();

        $form->handleRequest($request);

        if ($form->isSubmitted()) {

            die(); //breakpoint

            $em = $this->getDoctrine()->getManager();
            $em->persist($email);
            $em->flush();

            $this->addFlash('success', 'Email was successfully saved.');
        }

      return $this->render('newsLetter.html.twig', array('form' => $form->createView()));
    }
}

And finally newsletter.html.twig

<div class="newsletter">
  <p>Nechte si zasílat články e-mailem</p>
  {{ form_start(form) }}
    {{ form_widget(form) }}
    {{ form_end(form) }}
</div>

So the form is correctly rendered, but nothing happens after submit.

When you add a form without specifying the action it will post back to the same url that rendered it. So if you have a form that appears on multiple pages each controller function must be able to handle that form.

You could either create a base Controller that has that function and extend your other controllers. If you did it this way, each action method would have to call this function and you would have to handle the submit of the form individually as you may have multiple forms on that page.
E.g $emailAction = $form->get('addEmail')->isClicked()

Or you could set the action of your form to a dedicated route that would handle just that form, and then maybe redirect back to the original url (maybe pass it as a hidden field, the choice is yours).
E.g

$form = $this->createForm(Foo::class, $task, array(
    'action' => $this->generateUrl('target_route'),
    'method' => 'POST',
));