summaryrefslogtreecommitdiffstats
path: root/user_guide/helpers
diff options
context:
space:
mode:
authorPhil Sturgeon <email@philsturgeon.co.uk>2011-08-13 18:28:45 +0200
committerPhil Sturgeon <email@philsturgeon.co.uk>2011-08-13 18:28:45 +0200
commit3cf2715501be298ef00166d57a4df39829aa2c09 (patch)
tree9a67222945f8484c3130ec56ab6cc8ef2575ec11 /user_guide/helpers
parent6f1b3841b6f660dfbaa5e00df456d793e67fe60f (diff)
parentc4f024641ab69ed9cce62a2864e47e060b81048b (diff)
Merge branch 'develop' of ellislab.beanstalkapp.com:/codeigniter into develop
Diffstat (limited to 'user_guide/helpers')
-rw-r--r--user_guide/helpers/url_helper.html16
1 files changed, 15 insertions, 1 deletions
diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html
index d20f1b1e2..ac9d0a68e 100644
--- a/user_guide/helpers/url_helper.html
+++ b/user_guide/helpers/url_helper.html
@@ -70,7 +70,7 @@ URL Helper
<h2>site_url()</h2>
<p>Returns your site URL, as specified in your config file. The index.php file (or whatever you have set as your
-site <dfn>index_page</dfn> in your config file) will be added to the URL, as will any URI segments you pass to the function.</p>
+site <dfn>index_page</dfn> in your config file) will be added to the URL, as will any URI segments you pass to the function, and the <dfn>url_suffix</dfn> as set in your config file.</p>
<p>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.</p>
@@ -93,6 +93,20 @@ echo site_url($segments);</code>
<p>Returns your site base URL, as specified in your config file. Example:</p>
<code>echo base_url();</code>
+<p>This function returns the same thing as site_url, without the <dfn>index_page</dfn> or <dfn>url_suffix</dfn> being appended.</p>
+
+<p>Also like site_url, you can supply segments as a string or an array. Here is a string example:</p>
+
+<code>echo base_url("blog/post/123");</code>
+
+<p>The above example would return something like: http://example.com/blog/post/123</p>
+
+<p>This is useful because unlike site_url(), you can supply a string to a file, such as an image or stylesheet. For example:</p>
+
+<code>echo base_url("images/icons/edit.png");</code>
+
+<p>This would give you something like: http://example.com/images/icons/edit.png</p>
+
<h2>current_url()</h2>
<p>Returns the full URL (including segments) of the page being currently viewed.</p>