You are here

protected function AutosaveFormAlterTrait::getRequestMethod in Autosave Form 8

Returns the HTTP method used by the request that is building the form.

Return value

string Can be any valid HTTP method, such as GET, POST, HEAD, etc.

File

src/Form/AutosaveFormAlterTrait.php, line 278

Class

AutosaveFormAlterTrait
Provides a trait for common autosave form alterations.

Namespace

Drupal\autosave_form\Form

Code

protected function getRequestMethod() {
  return \Drupal::requestStack()
    ->getCurrentRequest()
    ->getMethod();
}