From 05633d7348b85147a46a7396c3bee1928335fa7a Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 21 Sep 2006 17:22:21 +0000 Subject: --- user_guide/libraries/uri.html | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) (limited to 'user_guide/libraries') diff --git a/user_guide/libraries/uri.html b/user_guide/libraries/uri.html index e56bf256f..bc8f0800e 100644 --- a/user_guide/libraries/uri.html +++ b/user_guide/libraries/uri.html @@ -63,7 +63,8 @@ URI Class

URI Class

-

The URI Class provides functions that help you retrieve information from your URI strings.

+

The URI Class provides functions that help you retrieve information from your URI strings. If you use URI routing, you can +also retrieve information about the re-routed segments.

Note: This class is initialized automatically by the system so there is no need to do it manually.

@@ -101,10 +102,15 @@ else
}
+

$this->uri->rsegment(n)

+ +

This function is identical to the previous one, except that it lets you retrieve a specific segment from your +re-routed URI in the event you are using Code Igniter's URI Routing feature. +

$this->uri->slash_segment(n)

-

This function is almost identical to the one above, except it adds a trailing and/or leading slash based on the second +

This function is almost identical to $this->uri->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);
@@ -120,6 +126,13 @@ $this->uri->slash_segment(3, 'both');
+

$this->uri->slash_rsegment(n)

+ +

This function is identical to the previous one, except that it lets you add slashes a specific segment from your +re-routed URI in the event you are using Code Igniter's URI Routing feature. + + +

$this->uri->uri_to_assoc(n)

This function lets you turn URI segments into and associative array of key/value pairs. Consider this URI:

@@ -157,6 +170,13 @@ $array = $this->uri->uri_to_assoc(3, $default);

Lastly, if a corresponding value is not found for a given key (if there is an odd number of URI segments) the value will be set to FALSE (boolean).

+

$this->uri->ruri_to_assoc(n)

+ +

This function is identical to the previous one, except that it creates an associative array using the +re-routed URI in the event you are using Code Igniter's URI Routing feature. + + +

$this->uri->assoc_to_uri()

Takes an associative array as input and generates a URI string from it. The array keys will be included in the string. Example:

@@ -180,11 +200,24 @@ $str = $this->uri->assoc_to_str($array);
news/local/345 +

$this->uri->ruri_string(n)

+ +

This function is identical to the previous one, except that it returns the +re-routed URI in the event you are using Code Igniter's URI Routing feature. + + +

$this->uri->total_segments()

Returns the total number of segments.

+

$this->uri->total_rsegments(n)

+ +

This function is identical to the previous one, except that it returns the total number of segments in your +re-routed URI in the event you are using Code Igniter's URI Routing feature. + +

$this->uri->segment_array()

@@ -199,6 +232,11 @@ foreach ($segs as $segment)
    echo '<br />';
} +

$this->uri->rsegment_array(n)

+ +

This function is identical to the previous one, except that it returns the array of segments in your +re-routed URI in the event you are using Code Igniter's URI Routing feature. + -- cgit v1.2.3-24-g4f1b