Merge pull request #523 from skipperbent/v4-isPostBack

[FEATURE] Added Request::isPostBack helper method
This commit is contained in:
Simon Sessingø
2021-03-28 04:25:54 +02:00
committed by GitHub
2 changed files with 15 additions and 4 deletions
+10
View File
@@ -362,6 +362,16 @@ class Request
return (strtolower($this->getHeader('http-x-requested-with')) === 'xmlhttprequest');
}
/**
* Returns true when request-type is post.
*
* @return bool
*/
public function isPostBack(): bool
{
return ($this->getMethod() === static::REQUEST_TYPE_POST);
}
/**
* Get accept formats
* @return array