Skip to content

Instantly share code, notes, and snippets.

@jocoonopa
Created November 19, 2013 02:25
Show Gist options
  • Save jocoonopa/7539242 to your computer and use it in GitHub Desktop.
Save jocoonopa/7539242 to your computer and use it in GitHub Desktop.
<?php
/**
* Displays a form to edit an existing User entity.
*
* @Route("/{id}/edit", name="user_edit")
* @Method("GET")
* @Template()
*/
public function editAction( User $entity )
{
$em = $this->getDoctrine()->getManager();
/*
$entity = $em->getRepository('WorkshopBackendBundle:User')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find User entity.');
}
*/
$editForm = $this->createEditForm( $entity );
$deleteForm = $this->createDeleteForm( $entity->getId() );
return array(
'entity' => $entity,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment