ice framework documentation ice doc v1.10.1
Methods
  • __construct() : void
    Request constructor. Fetch data from globals variables: _REQUEST, _SERVER, _POST, _GET and _FILES.
  • hasRequest(string $name) : bool
    Check whether _REQUEST has index.
  • hasPost(string $name) : bool
    Check whether _POST has index.
  • hasGet(string $name) : bool
    Check whether _GET has index.
  • hasServer(string $name) : bool
    Check whether _SERVER has index.
  • hasFile(string $name) : bool
    Check whether _FILES has index.
  • isPost() : bool
    Checks whether HTTP method is POST.
  • isGet() : bool
    Checks whether HTTP method is GET.
  • isPut() : bool
    Checks whether HTTP method is PUT.
  • isPatch() : bool
    Checks whether HTTP method is PATCH.
  • isHead() : bool
    Checks whether HTTP method is HEAD.
  • isDelete() : bool
    Checks whether HTTP method is DELETE.
  • isOptions() : bool
    Checks whether HTTP method is OPTIONS.
  • isAjax() : bool
    Checks whether request has been made using AJAX.
  • getMethod() : string
    Gets HTTP method which request has been made.
  • getUserAgent() : string
    Gets HTTP user agent used to made the request.
  • getHTTPReferer() : string
    Gets web page that refers active request.
  • getClientAddress() : string
    Gets most possible client IPv4 Address.
  • getQuery(string $key, variable $filters, variable $defaultValue, bool $allowEmpty) : void
    Gets variable from _GET superglobal applying filters if needed.
  • getPost(string $key, variable $filters, variable $defaultValue, bool $allowEmpty) : void
    Gets variable from _POST superglobal applying filters if needed.
  • getServer(string $key, variable $defaultValue) : void
    Gets variable from _SERVER superglobal.
  • getFiles(string $key, variable $defaultValue) : void
    Gets variable from _FILES superglobal.
Methods Details
  • public function __construct()

    Request constructor. Fetch data from globals variables: _REQUEST, _SERVER, _POST, _GET and _FILES.
  • public function hasRequest(string $name)

    Check whether _REQUEST has index.
  • public function hasPost(string $name)

    Check whether _POST has index.
  • public function hasGet(string $name)

    Check whether _GET has index.
  • public function hasServer(string $name)

    Check whether _SERVER has index.
  • public function hasFile(string $name)

    Check whether _FILES has index.
  • public function isPost()

    Checks whether HTTP method is POST.
  • public function isGet()

    Checks whether HTTP method is GET.
  • public function isPut()

    Checks whether HTTP method is PUT.
  • public function isPatch()

    Checks whether HTTP method is PATCH.
  • public function isHead()

    Checks whether HTTP method is HEAD.
  • public function isDelete()

    Checks whether HTTP method is DELETE.
  • public function isOptions()

    Checks whether HTTP method is OPTIONS.
  • public function isAjax()

    Checks whether request has been made using AJAX.
  • public function getMethod()

    Gets HTTP method which request has been made.
  • public function getUserAgent()

    Gets HTTP user agent used to made the request.
  • public function getHTTPReferer()

    Gets web page that refers active request.
  • public function getClientAddress()

    Gets most possible client IPv4 Address.
  • public function getQuery(string $key, variable $filters, variable $defaultValue, bool $allowEmpty)

    Gets variable from _GET superglobal applying filters if needed.
    If no parameters are given, return all.
    
          //Returns value from $_GET["id"] without sanitizing
          $id = $this->request->getQuery("id");
         
          //Returns value from $_GET["title"] with sanitizing
          $title = $this->request->getQuery("title", "escape|repeats");
         
          //Returns value from $_GET["id"] with a default value
          $id = $this->request->getQuery("id", null, 150);
         
  • public function getPost(string $key, variable $filters, variable $defaultValue, bool $allowEmpty)

    Gets variable from _POST superglobal applying filters if needed.
    If no parameters are given, return all.
    
          //Returns value from $_POST["id"] without sanitizing
          $id = $this->request->getPost("id");
         
          //Returns value from $_POST["title"] with sanitizing
          $title = $this->request->getPost("title", "escape|repeats");
         
          //Returns value from $_POST["id"] with a default value
          $id = $this->request->getPost("id", null, 150);
         
  • public function getServer(string $key, variable $defaultValue)

    Gets variable from _SERVER superglobal.
  • public function getFiles(string $key, variable $defaultValue)

    Gets variable from _FILES superglobal.