getMethod() public méthode

If no method is defined in the form, GET is returned.
public getMethod ( ) : string
Résultat string The method
 protected function makeRequestUsingForm(Form $form)
 {
     $files = [];
     $plainFiles = $form->getFiles();
     foreach ($plainFiles as $key => $file) {
         $files[$key] = new UploadedFile($file['tmp_name'], $file['name'], $file['type'], $file['size'], $file['error'], true);
     }
     return $this->makeRequest($form->getMethod(), $form->getUri(), $form->getValues(), [], $files);
 }
    /**
     * Submits a form.
     *
     * @param Form  $form   A Form instance
     * @param array $values An array of form field values
     *
     * @api
     */
    public function submit(Form $form, array $values = array())
    {
        $form->setValues($values);

        return $this->request($form->getMethod(), $form->getUri(), $form->getPhpValues(), $form->getPhpFiles());
    }
Exemple #3
0
 /**
  * Make a request to the application using the given form.
  *
  * @param  \Symfony\Component\DomCrawler\Form  $form
  * @return $this
  */
 protected function makeRequestUsingForm(Form $form)
 {
     return $this->makeRequest($form->getMethod(), $form->getUri(), $this->extractParametersFromForm($form), [], $form->getFiles());
 }
 /**
  * Make a request to a URL using form parameters.
  *
  * @param  Form $form
  * @return static
  */
 protected function makeRequestUsingForm(Form $form)
 {
     return $this->makeRequest($form->getMethod(), $form->getUri(), $form->getValues(), [], $form->getFiles());
 }
 /**
  * Submit a form
  *
  * @param \Symfony\Component\DomCrawler\Form $form
  * @return \TYPO3\Flow\Http\Response
  * @api
  */
 public function submit(Form $form)
 {
     return $this->request($form->getUri(), $form->getMethod(), $form->getPhpValues(), $form->getPhpFiles());
 }
Exemple #6
0
 /**
  * @param Form    $form
  * @param string  $package
  * @param string  $slug
  * @param Session $session
  *
  * @return Promise
  *
  * @rejects RequestException
  */
 public function disableModuleAsync(Form $form, $package, $slug, Session $session)
 {
     $formData = $form->getPhpValues();
     if (empty($formData['modules'][$package][$slug]['enable'])) {
         // The module is already disabled.
         return new FulfilledPromise(null);
     }
     unset($formData['modules'][$package][$slug]['enable']);
     return $this->client->requestAsync($form->getMethod(), $form->getUri(), [RequestOptions::COOKIES => $session->getCookieJar(), RequestOptions::AUTH => $session->getAuthData(), RequestOptions::FORM_PARAMS => $formData, RequestOptions::HEADERS => ['referer' => $form->getUri()], RequestOptions::ALLOW_REDIRECTS => false])->then(function () {
         // Resolve to null.
     });
 }