You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/development/legacy/helpers/url-helper.md
+2-21Lines changed: 2 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,17 +39,12 @@ Returns your site URL, as specified in your config file. The index.php file (or
39
39
40
40
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.
41
41
42
-
Segments can be optionally passed to the function as a string or an array. Here is a string example:
42
+
Segments can be optionally passed to the function as a string. Here is a string example:
43
43
44
-
echo site_url('news/local/123');
44
+
echo site_url('/news/local/123');
45
45
46
46
The above example would return something like: `https://example.com/news/local/123`
47
47
48
-
Here is an example of segments passed as an array:
49
-
50
-
$segments = array('news', 'local', '123');
51
-
echo site_url($segments);
52
-
53
48
This function is an alias for `EE_Config::site_url()`.
54
49
55
50
### `base_url($uri = '', $protocol = NULL)`
@@ -66,20 +61,6 @@ Returns your site base URL, as specified in your config file. Example:
66
61
67
62
This function returns the same thing as `site_url()`, without the _index_page_ being appended.
68
63
69
-
Also like `site_url()`, you can supply segments as a string or an array. Here is a string example:
70
-
71
-
echo base_url("blog/post/123");
72
-
73
-
The above example would return something like: `https://example.com/blog/post/123`
74
-
75
-
This is useful because unlike `site_url()`, you can supply a string to a file, such as an image or stylesheet. For example:
76
-
77
-
echo base_url("images/icons/edit.png");
78
-
79
-
This would give you something like: `https://example.com/images/icons/edit.png`
80
-
81
-
This function is an alias for `EE_Config::base_url()`.
0 commit comments