2024-07-22 04:27:02 +02:00

33 lines
923 B
PHP

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