]>
src.bluestatic.org Git - hoplite.git/blob - request.php
f1ad7eb91276c074680b12a3482f493595f6f607
3 // Copyright (c) 2016 Blue Static
5 // This program is free software: you can redistribute it and/or modify it
6 // under the terms of the GNU General Public License as published by the Free
7 // Software Foundation, either version 3 of the License, or any later version.
9 // This program is distributed in the hope that it will be useful, but WITHOUT
10 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 // You should have received a copy of the GNU General Public License along with
15 // this program. If not, see <http://www.gnu.org/licenses/>.
17 namespace hoplite\http2
;
20 A Request represents a HTTP request and holds the data and context associated
25 /*! @var string The request method (upper case). */
26 public $http_method = NULL;
28 /*! @var string The URL, relataive to the RootController. */
31 /*! @var array HTTP request data. */
34 /*! @var array Context data. */
38 Constructor. Takes an optional URL.
40 public function __construct($url='')
46 Wrapper around filter_input() that stores the result in the ::$data field.
48 public function filter($type, $name, $filter=FILTER_SANITIZE_STRING
, $options=NULL)
50 $rv = filter_input($type, $name, $filter, $options);
51 $this->data
[$name] = $rv;
56 Wrapper around filter_input() that merges the result in the ::$data field.
58 public function filterArray($type, $definition, $add_empty=TRUE)
60 $rv = filter_input_array($type, $definition, $add_empty);
61 $this->data
= array_merge($this->data
, $rv);