From 4b9c62980599228f070b401c7673dce8085b0c61 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 1 Jul 2011 17:40:48 -0500 Subject: backed out 648b42a75739, which was a NON-trivial whitespace commit. It broke the Typography class's string replacements, for instance --- user_guide/helpers/url_helper.html | 48 +++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'user_guide/helpers/url_helper.html') diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html index 0bcf1e7ae..d20f1b1e2 100644 --- a/user_guide/helpers/url_helper.html +++ b/user_guide/helpers/url_helper.html @@ -69,13 +69,13 @@ URL Helper

site_url()

-

Returns your site URL, as specified in your config file. The index.php file (or whatever you have set as your +

Returns your site URL, as specified in your config file. The index.php file (or whatever you have set as your site index_page in your config file) will be added to the URL, as will any URI segments you pass to the function.

You are encouraged to use this function any time you need to generate a local URL so that your pages become more portable in the event your URL changes.

-

Segments can be optionally passed to the function as a string or an array. Here is a string example:

+

Segments can be optionally passed to the function as a string or an array. Here is a string example:

echo site_url("news/local/123"); @@ -90,7 +90,7 @@ echo site_url($segments);

base_url()

-

Returns your site base URL, as specified in your config file. Example:

+

Returns your site base URL, as specified in your config file. Example:

echo base_url(); @@ -99,7 +99,7 @@ echo site_url($segments);

uri_string()

-

Returns the URI segments of any page that contains this function. For example, if your URL was this:

+

Returns the URI segments of any page that contains this function. For example, if your URL was this:

http://some-site.com/blog/comments/123

The function would return:

@@ -107,7 +107,7 @@ echo site_url($segments);

index_page()

-

Returns your site "index" page, as specified in your config file. Example:

+

Returns your site "index" page, as specified in your config file. Example:

echo index_page(); @@ -122,15 +122,15 @@ echo site_url($segments); anchor(uri segments, text, attributes) -

The first parameter can contain any segments you wish appended to the URL. As with the site_url() function above, +

The first parameter can contain any segments you wish appended to the URL. As with the site_url() function above, segments can be a string or an array.

-

Note:  If you are building links that are internal to your application do not include the base URL (http://...). This +

Note:  If you are building links that are internal to your application do not include the base URL (http://...). This will be added automatically from the information specified in your config file. Include only the URI segments you wish appended to the URL.

-

The second segment is the text you would like the link to say. If you leave it blank, the URL will be used.

+

The second segment is the text you would like the link to say. If you leave it blank, the URL will be used.

-

The third parameter can contain a list of attributes you would like added to the link. The attributes can be a simple string or an associative array.

+

The third parameter can contain a list of attributes you would like added to the link. The attributes can be a simple string or an associative array.

Here are some examples:

@@ -148,7 +148,7 @@ will be added automatically from the information specified in your config file.

Nearly identical to the anchor() function except that it opens the URL in a new window. You can specify JavaScript window attributes in the third parameter to control how the window is opened. If -the third parameter is not set it will simply open a new window with your own browser settings. Here is an example +the third parameter is not set it will simply open a new window with your own browser settings. Here is an example with attributes:

@@ -173,7 +173,7 @@ If you want the function to use all of its defaults simply pass an empty array i

mailto()

-

Creates a standard HTML email link. Usage example:

+

Creates a standard HTML email link. Usage example:

echo mailto('me@my-site.com', 'Click Here to Contact Me'); @@ -188,12 +188,12 @@ written with JavaScript to help prevent the email address from being harvested b

auto_link()

-

Automatically turns URLs and email addresses contained in a string into links. Example:

+

Automatically turns URLs and email addresses contained in a string into links. Example:

$string = auto_link($string); -

The second parameter determines whether URLs and emails are converted or just one or the other. Default behavior is both -if the parameter is not specified. Email links are encoded as safe_mailto() as shown above.

+

The second parameter determines whether URLs and emails are converted or just one or the other. Default behavior is both +if the parameter is not specified. Email links are encoded as safe_mailto() as shown above.

Converts only URLs:

$string = auto_link($string, 'url'); @@ -201,42 +201,42 @@ if the parameter is not specified. Email links are encoded as safe_mailto() as s

Converts only Email addresses:

$string = auto_link($string, 'email'); -

The third parameter determines whether links are shown in a new window. The value can be TRUE or FALSE (boolean):

+

The third parameter determines whether links are shown in a new window. The value can be TRUE or FALSE (boolean):

$string = auto_link($string, 'both', TRUE);

url_title()

Takes a string as input and creates a human-friendly URL string. This is useful if, for example, you have a blog -in which you'd like to use the title of your entries in the URL. Example:

+in which you'd like to use the title of your entries in the URL. Example:

$title = "What's wrong with CSS?";

$url_title = url_title($title);

-// Produces: Whats-wrong-with-CSS +// Produces: Whats-wrong-with-CSS
-

The second parameter determines the word delimiter. By default dashes are used. Options are: dash, or underscore:

+

The second parameter determines the word delimiter. By default dashes are used. Options are: dash, or underscore:

$title = "What's wrong with CSS?";

$url_title = url_title($title, 'underscore');

-// Produces: Whats_wrong_with_CSS +// Produces: Whats_wrong_with_CSS
-

The third parameter determines whether or not lowercase characters are forced. By default they are not. Options are boolean TRUE/FALSE:

+

The third parameter determines whether or not lowercase characters are forced. By default they are not. Options are boolean TRUE/FALSE:

$title = "What's wrong with CSS?";

$url_title = url_title($title, 'underscore', TRUE);

-// Produces: whats_wrong_with_css +// Produces: whats_wrong_with_css

prep_url()

-

This function will add http:// in the event that a scheme is missing from a URL. Pass the URL string to the function like this:

+

This function will add http:// in the event that a scheme is missing from a URL. Pass the URL string to the function like this:

$url = "example.com";

$url = prep_url($url);
@@ -250,7 +250,7 @@ $url = prep_url($url);
to the controller you want to direct to will create the link. The function will build the URL based on your config file values.

The optional second parameter allows you to choose between the "location" -method (default) or the "refresh" method. Location is faster, but on Windows servers it can sometimes be a problem. The optional third parameter allows you to send a specific HTTP Response Code - this could be used for example to create 301 redirects for search engine purposes. The default Response Code is 302. The third parameter is only available with 'location' redirects, and not 'refresh'. Examples:

+method (default) or the "refresh" method. Location is faster, but on Windows servers it can sometimes be a problem. The optional third parameter allows you to send a specific HTTP Response Code - this could be used for example to create 301 redirects for search engine purposes. The default Response Code is 302. The third parameter is only available with 'location' redirects, and not 'refresh'. Examples:

if ($logged_in == FALSE)
{
@@ -262,7 +262,7 @@ redirect('/article/13', 'location', 301);

Note: In order for this function to work it must be used before anything is outputted to the browser since it utilizes server headers.
-Note: For very fine grained control over headers, you should use the Output Library's set_header() function.

+Note: For very fine grained control over headers, you should use the Output Library's set_header() function.

-- cgit v1.2.3-24-g4f1b