src/PHPDish/Bundle/UserBundle/Controller/SettingController.php
public function editProfileAction(Request $request)
    {
        $this->denyAccessUnlessGranted('IS_AUTHENTICATED_REMEMBERED');
        $user = $this->getUser();
        $form = $this->createForm(ChangeUserProfileType::class, $user);
        $form->handleRequest($request);
        if ($form->isSubmitted() && $form->isValid()) {
            $this->getUserManager()->saveUser($user);
            /** @var TranslatorInterface */
            $translator = $this->get('translator');
            $this->addFlash('success', $translator->trans('profile.edit.success'));

            return $this->redirectToRoute('setting_profile');
        }

        return $this->render($this->configuration->getTemplate('Setting:profile.html.twig'), [
            'form' => $form->createView(),
        ]);
    }
public function editProfileAction(Request $request)
    {
        $this->denyAccessUnlessGranted('IS_AUTHENTICATED_REMEMBERED');
        $user = $this->getUser();
        $form = $this->createForm(ChangeUserProfileType::class, $user);
        $form->handleRequest($request);
        if ($form->isSubmitted() && $form->isValid()) {
            $this->getUserManager()->saveUser($user);
            /** @var TranslatorInterface */
            $translator = $this->get('translator');
            $this->addFlash('success', $translator->trans('profile.edit.success'));

            return $this->redirectToRoute('setting_profile');
        }

        return $this->render($this->configuration->getTemplate('Setting:profile.html.twig'), [
            'form' => $form->createView(),
        ]);
    }
修改资料.

@Route("/settings", name="setting_profile")

@param Request $request

@return Response