mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 02:12:13 +00:00
Development + bugfixes
This commit is contained in:
@@ -25,7 +25,7 @@ class Input {
|
||||
*/
|
||||
protected $request;
|
||||
|
||||
public function __construct(Request &$request) {
|
||||
public function __construct(Request $request) {
|
||||
$this->request = $request;
|
||||
$this->setGet();
|
||||
$this->setPost();
|
||||
|
||||
@@ -10,9 +10,10 @@ class InputCollection implements \IteratorAggregate {
|
||||
* Useful for searching for finding items where $index doesn't contain form name.
|
||||
*
|
||||
* @param string $index
|
||||
* @param string|null $defaultValue
|
||||
* @return mixed
|
||||
*/
|
||||
public function findFirst($index) {
|
||||
public function findFirst($index, $defaultValue = null) {
|
||||
if(count($this->data)) {
|
||||
|
||||
if(isset($this->data[$index])) {
|
||||
@@ -26,7 +27,7 @@ class InputCollection implements \IteratorAggregate {
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
return $defaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user