WIP
This commit is contained in:
parent
21977588d8
commit
f7fa124535
21 changed files with 388 additions and 58 deletions
|
|
@ -8,6 +8,7 @@ class ArgumentHandler
|
|||
{
|
||||
public static ?ArgumentHandler $instance = null;
|
||||
private array $arguments = [];
|
||||
private array $post = [];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
|
@ -16,6 +17,7 @@ class ArgumentHandler
|
|||
}
|
||||
foreach ($_POST as $key => $item) {
|
||||
$this->arguments[htmlspecialchars($key)] = htmlspecialchars($item);
|
||||
$this->post[htmlspecialchars($key)] = htmlspecialchars($item);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -41,4 +43,14 @@ class ArgumentHandler
|
|||
{
|
||||
return isset($this->arguments[$key]);
|
||||
}
|
||||
|
||||
public function getPostItem(string $key, $default = null)
|
||||
{
|
||||
return $this->post[$key] ?? $default;
|
||||
}
|
||||
|
||||
public function hasPostItem(string $key): bool
|
||||
{
|
||||
return isset($this->post[$key]);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue