| 1 | <?php |
||
| 6 | class Test extends Controller |
||
| 7 | { |
||
| 8 | public function __construct() |
||
| 9 | { |
||
| 10 | parent::__construct(); |
||
| 11 | } |
||
| 12 | |||
| 13 | public function receiveGet() |
||
| 14 | { |
||
| 15 | $this->response->throwJSON($this->request->get()); |
||
| 16 | } |
||
| 17 | |||
| 18 | public function receivePost() |
||
| 19 | { |
||
| 20 | $this->response->throwJSON($this->request->post()); |
||
| 21 | } |
||
| 22 | |||
| 23 | public function setAndGetCookie() |
||
| 24 | { |
||
| 25 | $this->request->cookie('name', 'honoka'); |
||
| 26 | $this->response->throwJSON($this->request->cookie('name')); |
||
| 27 | } |
||
| 28 | |||
| 29 | public function deleteCookie() |
||
| 30 | { |
||
| 31 | $this->request->cookie('name', 'honoka'); |
||
| 32 | $this->request->cookie('name', null); |
||
| 33 | $this->response->throwJSON($this->request->cookie('name')); |
||
| 34 | } |
||
| 35 | |||
| 36 | public function isSecure() |
||
| 37 | { |
||
| 38 | $this->response->throwJSON($this->request->isSecure()); |
||
| 39 | } |
||
| 40 | |||
| 41 | public function getBaseUrl() |
||
| 42 | { |
||
| 43 | $this->response->throwJSON($this->request->getBaseUrl()); |
||
| 44 | } |
||
| 45 | } |
||
| 46 |