Skip to content

Commit

Permalink
It's easier to retrieve form data
Browse files Browse the repository at this point in the history
  • Loading branch information
kocsismate committed Dec 3, 2014
1 parent 00e5d98 commit 1cb45a5
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#### Added
- Session handling
- Easier to retrieve POST-ed form data

### 0.3.0 - 2014-10-25

Expand Down
18 changes: 18 additions & 0 deletions src/Request/FoundationRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,4 +377,22 @@ public function getDataDeserialized()

return $this->requestParameters;
}

/**
* @param string $key
* @return boolean
*/
public function hasFormData($key)
{
return $this->request->request->has($key);
}

/**
* @param string $key
* @return mixed
*/
public function getFormData($key)
{
return $this->request->request->get($key);
}
}
12 changes: 12 additions & 0 deletions src/Request/RequestInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,16 @@ public function getBodyDeserialized();
* @return array
*/
public function getDataDeserialized();

/**
* @param string $key
* @return boolean
*/
public function hasFormData($key);

/**
* @param string $key
* @return mixed
*/
public function getFormData($key);
}

0 comments on commit 1cb45a5

Please sign in to comment.