Codeigniter Request Class

Check HTTP method

$this->request->getMethod()

Retrieving Input values

$this->request->getVar('input_element_name')

Retrieving GET request input value

$this->request->getGet('input_element_name')

Retrieving POST request input value

$this->request->getPost('input_element_name')

Retrieving Cookie value

$this->request->getCookie('cookie_name')

Retrieving GET request input value

$this->request->getGet('input_element_name')

Get request URL

$uri = $this->request->uri;

Grab any part of the request

Methods Return 
getScheme() http or https
getHost() website.com
getPath() Path of a request
getSegments() Return array of segments
getSegment(segment_pos) Return segment value of given segment position
getTotalSegments() Return no of segment

 

© 2016 - 2022, All Rights are Reserved.