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 +++++++++++++++- user_guide/libraries/config.html | 5 +++++ 2 files changed, 20 insertions(+), 1 deletion(-) (limited to 'user_guide') 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.

diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index 98b6052a9..103161f5d 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -175,6 +175,11 @@ define('ENVIRONMENT', 'development');

$this->config->site_url();

This function retrieves the URL to your site, along with the "index" value you've specified in the config file.

+

$this->config->base_url();

+

This function retrieves the URL to your site, plus an optional path such as to a stylesheet or image.

+ +

The two functions above are normally accessed via the corresponding functions in the URL Helper.

+

$this->config->system_url();

This function retrieves the URL to your system folder.

-- cgit v1.2.3-24-g4f1b