Edit action renders the attendee form, populated with existing details.
@param HTTPRequest $request
@return array
336337
public function edit($request) {
		//get attendee from registration
		$attendee = $this->registration->Attendees()
			->byID($request->param('ID'));
		if(!$attendee) {
			return $this->httpError(404, "Attendee not found");
		}
		$form = $this->AttendeeForm();
		//add tickets dropdown, if there is no selected ticket
		$ticket = $attendee->Ticket();
		if(!$ticket->exists()){
			$form->setAllowedTickets(
				$this->registration->Event()->getAvailableTickets()
			);
		}
		if (!$form->hasSessionData()) {
			$form->loadDataFrom($attendee);
		}
		//add tickets dropdown, if there is no selected ticket
		$form->getValidator()->addRequiredField("ID");
		$this->extend("onEdit", $form, $attendee, $this->registration);
		return array(
			'Title' => $attendee->Ticket()->Title,
			'Form' => $form
		);
	}
1078637
public function editAction($id, Request $request)
    {
        $form = $this->container->get('form.factory')->createNamed(
            'skeleton',
            EditionType::class,
            $template = $this->container->get('synapse.template.loader')
                ->retrieveAll(array('id' => $id, 'scope' => TemplateInterface::GLOBAL_SCOPE))
                ->first(),
            array(
                'theme' => $request->attributes->get(
                    'synapse_theme',
                    $this->container->get('synapse')
                        ->enableDefaultTheme()
                        ->getCurrentTheme()
                ),
                'content_type' => $template->getContentType(),
                'action' => $formUrl = $this->container->get('router')->generate(
                    'synapse_admin_skeleton_edition',
                    array('id' => $template->getId())
                ),
                'method' => 'POST',
                'csrf_protection' => false,
            )
        );
        if ($request->request->has('skeleton')) {
            $form->handleRequest($request);
            if ($form->isValid()) {
                return $this->redirect(
                    $this->container->get('router')->generate(
                        'synapse_admin_skeleton_edition',
                        array('id' => $template->getId())
                    )
                );
            }
        }

        return $this->render('SynapseAdminBundle:Skeleton:edit.html.twig', array(
            'skeleton' => $template,
            'form' => $form->createView(),
        ));
    }
564880
public function editAction(Request $request, DataInterface $data, FamilyInterface $family = null)
    {
        $this->initDataFamily($data, $family);
        $form = $this->getForm($request, $data, $family->getFormOptions());

        $form->handleRequest($request);
        if ($form->isSubmitted() && $form->isValid()) {
            $this->saveEntity($data);

            $parameters = $request->query->all();
            $parameters['success'] = 1;

            return $this->redirectToEntity($data, 'edit', $parameters);
        }

        return $this->renderAction($this->getViewParameters($request, $form, $data));
    }
1254740
public function editAction(Request $request)
    {
        $form     = $this->validateRequestParameters($request);
        $resource = $this->mapper->getResource($request->get('id'));

        $this->mapper->populateResourceWithForm($resource, $form);
        $this->mapper->update($resource);

        // returns an empty 200 (OK)
        return new Response();
    }
1335949
public function renderAction(Request $request)
    {
        $data = (array) json_decode($request->getContent(), true);
        $menu = null;

        if (isset($data['data'])) {
            $menu = $this->getMenuFactory()->fromArray($data['data']);
        }

        return [
            'menu'    => $menu,
            'options' => isset($data['options']) ? $data['options'] : [],
        ];
    }
523726
public function editBillingAction(Request $request)
    {
        if($request->isXmlHttpRequest()){
            $em = $this->container->get('doctrine')->getManager();
            $checkoutManager = $this->container->get('checkout_manager');

            /** @var Address $address */
            $address = $checkoutManager->getBillingAddress();
            $form = $this->createForm('EcommerceBundle\Form\AddressType', $address, array('token_storage' => $this->container->get('security.token_storage')));

            if ('POST' === $request->getMethod()) {
                $form->handleRequest($request);

                if ($form->isValid()) {
                    $em->persist($address);
                    $em->flush();
                    $url = $this->container->get('router')->generate('core_actor_profile').'?billing=1';
                    $this->container->get('session')->getFlashBag()->add('success', 'account.address.added');
                    return new JsonResponse(array('status' => 'success', 'url' => $url));
                }else{
                    $template = $this->container->get('twig')->render("EcommerceBundle:Profile:Billing/billing.form.html.twig", array(
                        'billing_form' => $form->createView(),
                        'address' => $address
                    ));
                    return new JsonResponse(array('status' => 'error', 'answer' => $template));
                }
            }
        }else {
            throw new \Exception('Only by ajax');
        }
        
    }
847499
public function get_items( $request ) {
		$data = array();
		foreach ( get_post_types( array(), 'object' ) as $obj ) {
			if ( empty( $obj->show_in_rest ) || ( 'edit' === $request['context'] && ! current_user_can( $obj->cap->edit_posts ) ) ) {
				continue;
			}
			$post_type = $this->prepare_item_for_response( $obj, $request );
			$data[ $obj->name ] = $this->prepare_response_for_collection( $post_type );
		}
		return rest_ensure_response( $data );
	}
191613
public function formAction(Request $request)
    {
        $option = array('action' => $this->generateUrl('open_orchestra_backoffice_internal_link_form'));

        $option["method"] = "POST";
        if ("PATCH" === $request->getMethod()) {
            $option["validation_groups"] = false;
            $option["method"] = "PATCH";
        }
        $form = $this->createForm(
            'oo_internal_link',
            $request->query->all(),
            $option
        );

        $form->handleRequest($request);

        return $this->renderAdminForm($form);
    }
935513
public function EditForm($request = null) {
		HtmlEditorField::include_js();

		$cur = $this->getCurrentPageID();
		if ($cur) {
			$record = $this->currentPage();
			if (!$record)
				return false;
			if ($record && !$record->canView())
				return Security::permissionFailure($this);
		}

		if ($this->hasMethod('getEditForm')) {
			return $this->getEditForm($this->getCurrentPageID());
		}

		return false;
	}
1259316
public function fieldsAction(Request $request)
    {
        $locale = $this->getLocaleManager()->retrieveLocale($this->getUser(), $request->get('locale'));

        // Default contacts list
        return $this->handleView($this->view(array_values($this->getManager()->getFieldDescriptors($locale)), 200));
    }
648650
public function toggleAction(Request $request)
    {
        $context = $this->loadContext($request);

        $resource = $context->getResource();

        $this->isGranted('EDIT', $resource);

        if (null !== $field = $request->attributes->get('field')) {
            $accessor = PropertyAccess::createPropertyAccessor();
            $value = $accessor->getValue($resource, $field);
            $accessor->setValue($resource, $field, !$value);

            // TODO use ResourceManager
            $event = $this->getOperator()->update($resource);
            $event->toFlashes($this->getFlashBag());
        }

        // TODO Redirect to parent show

        return $this->redirectToReferer($this->generateUrl(
            $this->config->getRoute('list'),
            $context->getIdentifiers()
        ));
    }
772344
public function layoutAction(Request $request)
    {
        $container = $this->findContainerByRequest($request);

        $data = $request->request->get('data', []);

        try {
            $this->getEditor()->getLayoutAdapter()->updateContainerLayout($container, $data);
        } catch (EditorExceptionInterface $e) {
            return $this->handleException($e);
        }

        $this->validate($container);
        $this->persist($container);

        $data = [
            'containers' => [$this->getViewBuilder()->buildContainer($container)],
        ];

        return $this->buildResponse($data, self::SERIALIZE_LAYOUT);
    }
1118726
public function editAction(Request $request)
    {
        $block = $this->findBlockByRequest($request);

        try {
            $response = $this->getEditor()->getBlockManager()->update($block, $request);
        } catch (EditorExceptionInterface $e) {
            return $this->handleException($e);
        }

        if ($response instanceof Modal) {
            return $this->renderModal($response);
        } elseif ($response instanceof Response) {
            return $response;
        }

        $this->validate($block);
        $this->persist($block);

        $view = $this->getViewBuilder()->buildBlock($block);

        if (0 < strlen($block->getName())) {
            $data = ['widgets' => $view->widgets];
        } else {
            $data = ['blocks' => [$view]];
        }

        return $this->buildResponse($data, self::SERIALIZE_CONTENT);
    }
33933
public function editIndexAction(Request $request)
    {
        /* @var $em EntityManager */
        $em = $this->getDoctrine()->getManager();

        /* @var DashboardConfiguration $dashboardConfiguration */
        $dashboardConfiguration = $em
            ->getRepository('KunstmaanAdminBundle:DashboardConfiguration')
            ->findOneBy(array());

        if (is_null($dashboardConfiguration)) {
            $dashboardConfiguration = new DashboardConfiguration();
        }
        $form = $this->createForm(DashboardConfigurationType::class, $dashboardConfiguration);

        if ($request->isMethod('POST')) {
            $form->handleRequest($request);
            if ($form->isSubmitted() && $form->isValid()) {
                $em->persist($dashboardConfiguration);
                $em->flush($dashboardConfiguration);

                $this->addFlash(
                    FlashTypes::SUCCESS,
                    $this->get('translator')->trans('kuma_admin.edit.flash.success')
                );

                return new RedirectResponse($this->generateUrl('KunstmaanAdminBundle_homepage'));
            }
        }

        return array(
            'form' => $form->createView(),
            'dashboardConfiguration' => $dashboardConfiguration,
        );
    }
96819
public function editAction(Request $request)
    {
        $user = $this->getUser();
        $repository = $this->get('ekyna_user.address.repository');

        if (null === $address = $repository->find($request->attributes->get('addressId'))) {
            throw new NotFoundHttpException('Address not found.');
        }
        if ($address->getUser()->getId() !== $user->getId()) {
            throw new AccessDeniedHttpException('Access denied');
        }

        $cancelPath = $this->generateUrl('ekyna_user_address_list');

        /** @var \Symfony\Component\Form\FormInterface $form */
        $form = $this
            ->createForm('ekyna_user_address', $address, [
                '_redirect_enabled' => true,
            ])
            ->add('actions', 'form_actions', [
                'buttons' => [
                    'save' => [
                        'type' => 'submit', 'options' => [
                            'button_class' => 'primary',
                            'label' => 'ekyna_core.button.save',
                            'attr' => [
                                'icon' => 'ok',
                            ],
                        ],
                    ],
                    'cancel' => [
                        'type' => 'button', 'options' => [
                            'label' => 'ekyna_core.button.cancel',
                            'button_class' => 'default',
                            'as_link' => true,
                            'attr' => [
                                'class' => 'form-cancel-btn',
                                'icon' => 'remove',
                                'href' => $cancelPath,
                            ],
                        ],
                    ],
                ],
            ])
        ;

        $form->handleRequest($request);
        if ($form->isValid()) {
            $event = $this->get('ekyna_user.address.operator')->update($address);
            if (!$event->isPropagationStopped()) {
                $this->addFlash('ekyna_user.address.message.edit.success', 'success');
                if (null !== $redirectPath = $form->get('_redirect')->getData()) {
                    return $this->redirect($redirectPath);
                }
                return $this->redirect($cancelPath);
            }
            $this->addFlash('ekyna_user.address.message.edit.failure', 'danger');
        }

        return $this->render('EkynaUserBundle:Address:edit.html.twig', [
            'address' => $address,
            'form' => $form->createView()
        ]);
    }
1008237
public function formPage(Request $request) {
    if (!$this->config->get('use_ajax')) {
      $form_state = new FormState();
      $plugin = $this->loadCheckoutFlowPlugin();
      $form = $this->formBuilder->buildForm($plugin, $form_state);
      return $form;
    }

    return [
      '#attributes' => ['id' => 'acm_checkout_wrapper'],
      '#attached' => [
        'library' => ['acm_checkout/single_page_checkout'],
        'drupalSettings' => [
          'acm_checkout' => [
            'cartPath' => Url::fromRoute('acm_checkout.form')->toString(),
            'ajaxCartPath' => Url::fromRoute('acm_checkout.ajax_form')->toString(),
          ],
        ],
      ],
    ];
  }
68962
public function layoutAction(Request $request)
    {
        $row = $this->findRowByRequest($request);

        $data = $request->request->get('data', []);

        try {
            $this->getEditor()->getLayoutAdapter()->updateRowLayout($row, $data);
        } catch (EditorExceptionInterface $e) {
            return $this->handleException($e);
        }

        $this->validate($row);
        $this->persist($row);

        $data = [
            'rows' => [$this->getViewBuilder()->buildRow($row)],
        ];

        return $this->buildResponse($data, self::SERIALIZE_LAYOUT);
    }