From 76696d76e137e98f0597547b71b40a991d8b025b Mon Sep 17 00:00:00 2001 From: "anaxamaxan@blackdog.local" Date: Wed, 2 Feb 2011 23:09:54 -0800 Subject: Added docs for config->base_url() changes. --- user_guide/helpers/url_helper.html | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (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 6d8bdc240..de28a6f56 100644 --- a/user_guide/helpers/url_helper.html +++ b/user_guide/helpers/url_helper.html @@ -70,7 +70,7 @@ 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 -site index_page in your config file) will be added to the URL, as will any URI segments you pass to the function.

+site index_page in your config file) will be added to the URL, as will any URI segments you pass to the function, and the url_suffix as set in your config file.

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.

@@ -93,6 +93,20 @@ echo site_url($segments);

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

echo base_url(); +

This function returns the same thing as site_url, without the index_page or url_suffix being appended.

+ +

Also like site_url, you can supply segments as a string or an array. Here is a string example:

+ +echo base_url("blog/post/123"); + +

The above example would return something like: http://example.com/blog/post/123

+ +

This is useful because unlike site_url(), you can supply a string to a file, such as an image or stylesheet. For example:

+ +echo base_url("images/icons/edit.png"); + +

This would give you something like: http://example.com/images/icons/edit.png

+

current_url()

Returns the full URL (including segments) of the page being currently viewed.

-- cgit v1.2.3-24-g4f1b