Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
efe3b0ad5a | ||
|
|
d9a3deef90 | ||
|
|
0c121af290 |
@@ -12,7 +12,7 @@
|
|||||||
"ext-yaml": "*",
|
"ext-yaml": "*",
|
||||||
"psr/log": "^3.0.0",
|
"psr/log": "^3.0.0",
|
||||||
"psr/container": "^1.0",
|
"psr/container": "^1.0",
|
||||||
"rmphp/foundation": "^1.0"
|
"rmphp/foundation": "^2.0"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace Rmphp\Kernel;
|
|||||||
|
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
use Psr\Http\Message\UploadedFileInterface;
|
||||||
|
|
||||||
class Globals {
|
class Globals {
|
||||||
|
|
||||||
@@ -150,10 +151,17 @@ class Globals {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $name
|
* @param string $name
|
||||||
* @return array|int|string
|
* @return array|UploadedFileInterface|null
|
||||||
*/
|
*/
|
||||||
public function files(string $name = "") {
|
public function files(string $name = ""): array|UploadedFileInterface|null {
|
||||||
return $this->onGlobal($this->request->getUploadedFiles(), $name);
|
$name = strtolower($name);
|
||||||
|
$var = $this->request->getUploadedFiles();
|
||||||
|
if (!empty($name))
|
||||||
|
{
|
||||||
|
if (!isset($var[$name])) return null;
|
||||||
|
return $var[$name];
|
||||||
|
}
|
||||||
|
return $var;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user