Esempio n. 1
0
<?php

namespace api\Requests;

class Requests
{
    public static $Post;
    public static $Get;
    public static $PhpInput;
    public static function Init()
    {
        self::$Post = $_POST;
        self::$Get = $_GET;
        self::$PhpInput = (array) json_decode(file_get_contents("php://input"));
    }
    public static function Get($var)
    {
        return isset(self::$Get[$var]) ? self::$Get[$var] : "";
    }
    public static function Post($var)
    {
        return isset(self::$Post[$var]) ? self::$Post[$var] : "";
    }
    public static function Php($var)
    {
        return isset(self::$PhpInput[$var]) ? self::$PhpInput[$var] : "";
    }
}
Requests::Init();