Routes for React

This commit is contained in:
2024-07-22 04:27:02 +02:00
parent 20db2301cb
commit 06ce614c2b
3 changed files with 13 additions and 9 deletions
+8 -4
View File
@@ -8,21 +8,25 @@ class Input
{
public static function post(string $index, $defaultValue = null)
{
return Request::request()->getInputHandler()->post($index, $defaultValue);
$value = Request::request()->getInputHandler()->post($index, $defaultValue);
return empty($value) ? null : $value->getValue();
}
public static function patch(string $index, $defaultValue = null)
{
return Request::request()->getInputHandler()->post($index, $defaultValue);
$value = Request::request()->getInputHandler()->post($index, $defaultValue);
return empty($value) ? null : $value->getValue();
}
public static function get(string $index, $defaultValue = null)
{
return Request::request()->getInputHandler()->get($index, $defaultValue);
$value = Request::request()->getInputHandler()->get($index, $defaultValue);
return empty($value) ? null : $value->getValue();
}
public static function file(string $index, $defaultValue = null)
{
return Request::request()->getInputHandler()->file($index, $defaultValue);
$value = Request::request()->getInputHandler()->file($index, $defaultValue);
return empty($value) ? null : $value->getValue();
}
}