mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-04-01 09:35:28 +00:00
implement request model
This commit is contained in:
parent
2279e0d44e
commit
0227f0c9ec
1 changed files with 54 additions and 0 deletions
54
src/app/model/request.php
Normal file
54
src/app/model/request.php
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
|
||||
class AppModelRequest {
|
||||
|
||||
private $_get;
|
||||
private $_post;
|
||||
private $_files;
|
||||
|
||||
public function __construct(array $get, array $post, array $files)
|
||||
{
|
||||
$this->_address = $address;
|
||||
$this->_post = $post;
|
||||
$this->_files = $files;
|
||||
}
|
||||
|
||||
public function get(string $key) : mixed
|
||||
{
|
||||
if (isset($this->_get[$key]))
|
||||
{
|
||||
return $this->_get[$key];
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function post(string $key) : mixed
|
||||
{
|
||||
if (isset($this->_post[$key]))
|
||||
{
|
||||
return $this->_post[$key];
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function files(string $key) : mixed
|
||||
{
|
||||
if (isset($this->_files[$key]))
|
||||
{
|
||||
return $this->_files[$key];
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue