Added input handler, redirector, session handler, and token handler.
This commit is contained in:
35
Core/Input.php
Normal file
35
Core/Input.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
namespace Core;
|
||||
|
||||
class Input
|
||||
{
|
||||
public static function exists($type = 'post')
|
||||
{
|
||||
switch ($type) {
|
||||
case 'post':
|
||||
return (!empty($_POST)) ? true : false;
|
||||
break;
|
||||
|
||||
case 'get':
|
||||
return (!empty($_GET)) ? true : false;
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public static function get($item)
|
||||
{
|
||||
if(isset($_POST[$item]))
|
||||
{
|
||||
return $_POST[$item];
|
||||
}
|
||||
elseif(isset($_GET[$item]))
|
||||
{
|
||||
return $_GET[$item];
|
||||
}
|
||||
return '';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user