Creates a form to edit a Center entity.

@param Center $center The entity

@return \Symfony\Component\Form\Form The form
354692
private function createEditForm(Center $center)
    {
        $form = $this->createForm(new CenterType(), $center, array(
            'action' => $this->generateUrl('admin_center_update', array('id' => $center->getId())),
            'method' => 'PUT',
        ));

        $form->add('submit', 'submit', array('label' => 'Update'));

        return $form;
    }
59031
private function createDeleteForm(Parameter $entity)
    {
        return $this->createFormBuilder()
            ->setAction($this->generateUrl('core_parameter_delete', array('id' => $entity->getId())))
            ->setMethod('DELETE')
            ->getForm()
        ;
    }
38740
public function editAction($id)
        {
            /** @var User $oUser */
            $oUser = UserQuery::create()->findOneById($id);

            if (count($oUser) === 0) {
                throw $this->createNotFoundException('Unable to find User entity.');
            }

            $editForm = $this->createEditForm($oUser);
            $deleteForm = $this->createDeleteForm($id);

            // preselect Role
            $editForm->get('roles')->setData($oUser->getRole());

            return $this->render('SlashworksBackendBundle:User:edit.html.twig', array(
                'entity'      => $oUser,
                'edit_form'   => $editForm->createView(),
                'delete_form' => $deleteForm->createView(),
            ));
        }
553375
public function setEditable($callback = NULL, \Nette\Forms\IControl $control = NULL)
    {
        $this->editable = TRUE;
        $this->setClientSideOptions();

        $callback && $this->setEditableCallback($callback);
        $control && $this->setEditableControl($control);

        return $this;
    }
173709
private function createCreateForm(Menu $entity)
    {
        $form = $this->createForm(new MenuType(), $entity, array(
            'action' => $this->generateUrl('admin_menu_create'),
            'method' => 'POST',
        ));

        $form->add('submit', 'submit', array('label' => 'Create'));

        return $form;
    }
729699
public function editAction()
    {
        // Load entity
        $entity = $this->getMapper()->findById($this->params('id'));
        if (!$entity) {
            // Add failure message
            $this->flashMessenger()
                    ->addMessage(
                            'That ' . strtolower($this->getEntityName())
                            . ' does not exist.'
            );
            return $this->redirect()->toRoute($this->indexRoute);
        }

        // Load form
        $form = $this->getForm('Edit' . $this->getEntityName());
        $form->bind($entity);

        // Implement Post/Redirect/Get pattern
        $prg = $this->prg();
        if ($prg instanceof Response) {
            return $prg;
        } else if (false !== $prg) {

            // Set form data
            $form->setData($prg);

            // Edit entity
            $result = $this->getService()->edit();
            if ($result) {
                return $this->redirect()->toRoute($this->indexRoute);
            }
        }

        // Set up view model
        $viewModel = new ViewModel(array(
            'entityName' => $this->getEntityName(),
            'form'       => $form,
        ));
        $viewModel->setTemplate('infinity-base/crud/edit');

        return $viewModel;
    }
1285596
public function createFacetAction()
    {
        $form = $this->formFactory->create(new FacetType(), new Facet());
        $form->handleRequest($this->request);

        if ($form->isValid()) {
            $facet = $this->facetManager->createFacet($form->get('name')->getData(), $form->get('forceCreationForm')->getData());

            return new JsonResponse(
                array('name' => $facet->getName(), 'position' => $facet->getPosition(), 'id' => $facet->getId())
            );
        }

       return $this->render(
           'ClarolineCoreBundle:Administration\Facet:facetForm.html.twig',
           array('form' => $form->createView())
       );
    }
931759
public function addAction() {

        $edit_form = $this->container->get("haven_core.category.form_handler")->createNewForm();

        $request = $this->container->get('request_modifier')->setRequest($this->container->get("request"))
                ->slug(array("name"))
                ->getRequest();

        $edit_form->bind($request);

        if ($edit_form->isValid()) {
            $this->container->get("haven_core.category.persistence_handler")->save($edit_form->getData());
            $this->container->get("session")->getFlashBag()->add("success", "create.success");

            return new RedirectResponse($this->container->get('router')->generate(str_replace('update', "list", $this->container->get("request")->get("_route"))));
        }

        $this->container->get("session")->getFlashBag()->add("error", "create.error");

        $template = str_replace(":create.html.twig", ":new.html.twig", $this->container->get("request")->get('_template'));
        $params = array(
            'edit_form' => $edit_form->createView()
        );

        return new Response($this->container->get('templating')->render($template, $params));
    }
1001905
private function createDeleteForm(Departamento $departamento)
    {
        return $this->createFormBuilder()
            ->setAction($this->generateUrl('departamento_delete', array('id' => $departamento->getId())))
            ->setMethod('DELETE')
            ->getForm()
        ;
    }
591344
public function CreationForm()
    {
        /** @var FieldList $fields */
        $fields = singleton($this->getRecordType())->getFrontEndFields();
        $fields->push(new HiddenField('ID'));
        $form = new Form(
            $this,
            'CreationForm',
            $fields,
            new FieldList(
                new FormAction('doSave', 'Save'),
                new FormAction('doCancel', 'Cancel')
            ));
        return $form;
    }
559567
public function editAction(Request $request, Located $located)
    {
        
        $deleteForm = $this->createDeleteForm($located);
        $editForm = $this->createForm('EcommerceBundle\Form\LocatedType', $located, array(
            'action' => $this->generateUrl('ecommerce_located_edit', array('id' => $located->getId())),
            'method' => 'POST',
        ));
        $editForm->handleRequest($request);

        if ($editForm->isSubmitted() && $editForm->isValid()) {
            $em = $this->getDoctrine()->getManager();
            
            $em->persist($located);
            $em->flush();
            
            $this->get('session')->getFlashBag()->add('success', 'located.edited');
            
            return $this->redirectToRoute('ecommerce_located_show', array('id' => $located->getId()));
        }

        return array(
            'entity' => $located,
            'edit_form' => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        );
    }
1268754
public function editAction($id)
        {

            /** @var Customer $oCustomer */
            $oCustomer = CustomerQuery::create()->findOneById($id);

            if (count($oCustomer) === 0) {
                throw $this->createNotFoundException('Unable to find Customer entity.');
            }

            $oEditForm   = $this->createEditForm($oCustomer);
            $oDeleteForm = $this->createDeleteForm($id);

            return $this->render('SlashworksAppBundle:Customer:edit.html.twig', array(
                'entity'      => $oCustomer,
                'edit_form'   => $oEditForm->createView(),
                'delete_form' => $oDeleteForm->createView(),
            ));
        }
654939
public function setCenter($center)
    {
        if (!$center instanceof LatLng) {
            $center = LatLng::fromNative($center);
        }

        Assertion::isInstanceOf($center, 'Netzmacht\LeafletPHP\Value\LatLng');

        return $this->setOption('center', $center);
    }
339360
public function edit($id)
    {
        // Fetch the user object
        // $id = $this->decode($hash);
        $user = $this->userRepository->findById($id);

        // Fetch the available roles
        $roles = app()->make('sentinel.roles')->createModel()->all();

        if ($user) {
            return view('Centaur::users.edit', [
                'user' => $user,
                'roles' => $roles
            ]);
        }

        session()->flash('error', 'Invalid user.');
        return redirect()->back();
    }
611166
private function createDeleteForm(Located $located)
    {
        return $this->createFormBuilder()
            ->setAction($this->generateUrl('ecommerce_located_delete', array('id' => $located->getId())))
            ->setMethod('DELETE')
            ->getForm()
        ;
    }
937148
private function createEditForm(GalleryItem $entity)
    {
        $form = $this->createForm(new GalleryItemType(), $entity, array(
            'action' => $this->generateUrl('admin_galleryitem_update', array('id' => $entity->getId())),
            'method' => 'PUT',
        ));

        $form->add('submit', 'submit', array('label' => 'Update'));

        return $form;
    }
697106
private function createEditForm(Menu $entity)
    {
        $form = $this->createForm(new MenuType(), $entity, array(
            'action' => $this->generateUrl('admin_menu_update', array('id' => $entity->getId())),
            'method' => 'PUT',
        ));

        $form->add('submit', 'submit', array('label' => 'Update'));

        return $form;
    }