Controller/UserController.php
public function editAction($id)
    {
        $em = $this->getDoctrine()->getManager();
        $user = $em->getRepository('Orkestra\Bundle\ApplicationBundle\Entity\User')->find($id);

        if (!$user) {
            throw $this->createNotFoundException('Unable to locate User');
        }

        $form = $this->createForm(UserType::class, $user, array('include_password' => false));

        return array(
            'user' => $user,
            'form' => $form->createView(),
        );
    }
public function editAction($id)
    {
        $em = $this->getDoctrine()->getManager();
        $user = $em->getRepository('Orkestra\Bundle\ApplicationBundle\Entity\User')->find($id);

        if (!$user) {
            throw $this->createNotFoundException('Unable to locate User');
        }

        $form = $this->createForm(UserType::class, $user, array('include_password' => false));

        return array(
            'user' => $user,
            'form' => $form->createView(),
        );
    }
Displays a form to edit an existing User entity.

@Route("/{id}/edit", name="orkestra_user_edit")
@Template()
@Secure(roles="ROLE_USER_WRITE")