Added input handler, redirector, session handler, and token handler.

This commit is contained in:
2017-09-04 16:25:11 +07:00
parent e1d70ed8f4
commit 06c4e2a74e
4 changed files with 139 additions and 0 deletions

35
Core/Input.php Normal file
View 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 '';
}
}