class Request
Class Request – the class for working with system requests.
<?php
class Request
{
/** * Instantiate the object * @return Request */static public function getInstance()
/** * Set query string parameter delimiter * For instance, “/” being set as a separator, the following query * http://yoursite.com/controller/action will be interpreted * as a parameterized request with two parameters * 0 — controller 1 - action * @param string $delimeter */static public function setDelimetr($delimeter)
/** * Set postfix address extension * (e.g. ".html" , ".xhtml" and the like) * @param string $extension */static public function setExtension($extension)
/** * Get cleared request URL * @return string */public function getUri()
/** * Get request part by index * The query string is divided into parts by the delimiter defined by the * method Request::setDelimentr are indexed with 0 * @param integer $index — index of the part * @return mixed string / false */public function getPart($index)
/** * Build system request URL * The method creates a string based on the defined parameter delimiter and * the parameter values array * @param array $paths — request parameters array * @return string — add postfix file extension*/
static public function url(array $paths , $useExstension = true)
/** * Get the list of sent files * @return array */static public function files()
/** * Get parameter transferred by the method $_GET * @param string $name — parameter name * @param string $type — the value type defining the way the data will be filtered. * The ‘Filter’ chapter expands on the list of supported types. Here is the basic list: * integer , boolean , float , string, cleaned_string , array и др. * @param mixed $default — default value if the parameter is missing. * @return mixed */static public function get($name , $type , $default)
/** * Get the parameter passed by $_POST method * @param string $name — parameter name * @param string $type — the value type defining the way the data will be filtered. * The ‘Filter’ chapter expands on the list of supported types. Here is the basic list: * integer , boolean , float , string, cleaned_string , array и др. * @param mixed $default — default value if the parameter is missing. * @return mixed */static public function post($name , $type , $default)
/** * Redefine $_POST parameter * @param string $name — parameter name * @param mixed $value — parameter value*/
static public function updatePost($name , $value)
/** * Get all parameters passed by the $_POST method in an array * @return array */static public function postArray()
}
comments powered by Disqus