- added ADMIN index file
- cleanup config - added Asset Controller
This commit is contained in:
parent
7ba4e3e0a6
commit
fe7bacd2f6
14 changed files with 300 additions and 33 deletions
37
src/Venom/ArgumentHandler.php
Normal file
37
src/Venom/ArgumentHandler.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
|
||||
namespace Venom;
|
||||
|
||||
|
||||
class ArgumentHandler
|
||||
{
|
||||
public static ?ArgumentHandler $instance = null;
|
||||
private array $arguments = [];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
foreach ($_GET as $key => $item) {
|
||||
$this->arguments[htmlspecialchars($key)] = htmlspecialchars($item);
|
||||
}
|
||||
foreach ($_POST as $key => $item) {
|
||||
$this->arguments[htmlspecialchars($key)] = htmlspecialchars($item);
|
||||
}
|
||||
}
|
||||
|
||||
public static function get(): ArgumentHandler
|
||||
{
|
||||
if (self::$instance == null) {
|
||||
self::$instance = new ArgumentHandler();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
public function getItem(string $key, $default = null)
|
||||
{
|
||||
if (isset($this->arguments[$key])) {
|
||||
return $this->arguments[$key];
|
||||
}
|
||||
return $default;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue