CI_URI::uri_string()

uri_string() Returns: URI string Return type: string Returns a string with the complete URI. For example, if this is your full URL: http://example.com/index.php/news/local/345 The method would return this: news/local/345

CI_URI::total_segments()

total_segments() Returns: Count of URI segments Return type: int Returns the total number of segments.

CI_URI::total_rsegments()

total_rsegments() Returns: Count of routed URI segments Return type: int This method is identical to total_segments(), except that it returns the total number of segments in your re-routed URI in the event you are using CodeIgniter’s URI Routing feature.

CI_URI::slash_segment()

slash_segment($n[, $where = 'trailing']) Parameters: $n (int) – Segment index number $where (string) – Where to add the slash (‘trailing’ or ‘leading’) Returns: Segment value, prepended/suffixed with a forward slash, or a slash if not found Return type: string This method is almost identical to segment(), except it adds a trailing and/or leading slash based on the second parameter. If the parameter is not used, a trailing slash added. Examples: $this->uri->slash_segment(3); $

CI_URI::slash_rsegment()

slash_rsegment($n[, $where = 'trailing']) Parameters: $n (int) – Segment index number $where (string) – Where to add the slash (‘trailing’ or ‘leading’) Returns: Routed segment value, prepended/suffixed with a forward slash, or a slash if not found Return type: string This method is identical to slash_segment(), except that it lets you add slashes a specific segment from your re-routed URI in the event you are using CodeIgniter’s URI Routing feature.

CI_URI::segment_array()

segment_array() Returns: URI segments array Return type: array Returns an array containing the URI segments. For example: $segs = $this->uri->segment_array(); foreach ($segs as $segment) { echo $segment; echo '<br />'; }

CI_URI::segment()

segment($n[, $no_result = NULL]) Parameters: $n (int) – Segment index number $no_result (mixed) – What to return if the searched segment is not found Returns: Segment value or $no_result value if not found Return type: mixed Permits you to retrieve a specific segment. Where n is the segment number you wish to retrieve. Segments are numbered from left to right. For example, if your full URL is this: http://example.com/index.php/news/local/metro/crime_is_up The segment numbers would

CI_URI::ruri_to_assoc()

ruri_to_assoc([$n = 3[, $default = array()]]) Parameters: $n (int) – Segment index number $default (array) – Default values Returns: Associative routed URI segments array Return type: array This method is identical to uri_to_assoc(), except that it creates an associative array using the re-routed URI in the event you are using CodeIgniter’s URI Routing feature.

CI_URI::ruri_string()

ruri_string() Returns: Routed URI string Return type: string This method is identical to uri_string(), except that it returns the re-routed URI in the event you are using CodeIgniter’s URI Routing feature.

CI_URI::rsegment_array()

rsegment_array() Returns: Routed URI segments array Return type: array This method is identical to segment_array(), except that it returns the array of segments in your re-routed URI in the event you are using CodeIgniter’s URI Routing feature.