2024-07-27 20:43:57 +02:00

37 lines
951 B
PHP

<?php
namespace Khofmann\Input;
use Khofmann\Request\Request;
class Input
{
private function __construct()
{
}
public static function post(string $index, $defaultValue = null)
{
$value = Request::request()->getInputHandler()->post($index, $defaultValue);
return !is_object($value) ? $value : $value->getValue();
}
public static function patch(string $index, $defaultValue = null)
{
$value = Request::request()->getInputHandler()->post($index, $defaultValue);
return !is_object($value) ? $value : $value->getValue();
}
public static function get(string $index, $defaultValue = null)
{
$value = Request::request()->getInputHandler()->get($index, $defaultValue);
return !is_object($value) ? $value : $value->getValue();
}
public static function file(string $index, $defaultValue = null)
{
$value = Request::request()->getInputHandler()->file($index, $defaultValue);
return $value;
}
}