@@ 5-17 (lines=13) @@ | ||
2 | ||
3 | namespace Tomaj\NetteApi\Params; |
|
4 | ||
5 | class GetInputParam extends InputParam |
|
6 | { |
|
7 | protected $type = self::TYPE_GET; |
|
8 | ||
9 | public function getValue() |
|
10 | { |
|
11 | if (!filter_has_var(INPUT_GET, $this->key) && isset($_GET[$this->key])) { |
|
12 | return $_GET[$this->key]; |
|
13 | } |
|
14 | $value = $this->isMulti() ? filter_input(INPUT_GET, $this->key, FILTER_DEFAULT, FILTER_REQUIRE_ARRAY) : filter_input(INPUT_GET, $this->key); |
|
15 | return $value !== null ? $value : $this->default; |
|
16 | } |
|
17 | } |
|
18 |
@@ 5-17 (lines=13) @@ | ||
2 | ||
3 | namespace Tomaj\NetteApi\Params; |
|
4 | ||
5 | class PostInputParam extends InputParam |
|
6 | { |
|
7 | protected $type = self::TYPE_POST; |
|
8 | ||
9 | public function getValue() |
|
10 | { |
|
11 | if (!filter_has_var(INPUT_POST, $this->key) && isset($_POST[$this->key])) { |
|
12 | return $_POST[$this->key]; |
|
13 | } |
|
14 | $value = $this->isMulti() ? filter_input(INPUT_POST, $this->key, FILTER_DEFAULT, FILTER_REQUIRE_ARRAY) : filter_input(INPUT_POST, $this->key); |
|
15 | return $value !== null ? $value : $this->default; |
|
16 | } |
|
17 | } |
|
18 |