From 76696d76e137e98f0597547b71b40a991d8b025b Mon Sep 17 00:00:00 2001
From: "anaxamaxan@blackdog.local" 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_url()
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
+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 function retrieves the URL to your site, along with the "index" value you've specified in the config file.
+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 function retrieves the URL to your system folder.
-- cgit v1.2.3-24-g4f1b