site_url()
site_url(string $uri = '', string $protocol = NULL) : string
Site URL
Create a local URL based on your basepath. Segments can be passed via the first parameter either as a string or an array.
Parameters
string | $uri | |
string | $protocol |
CodeIgniter
An open source application development framework for PHP
This content is released under the MIT License (MIT)
Copyright (c) 2014 - 2016, British Columbia Institute of Technology
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
base_url(string $uri = '', string $protocol = NULL) : string
Base URL
Create a local URL based on your basepath. Segments can be passed in as a string or an array, same as site_url or a URL to a file can be passed in, e.g. to an image file.
string | $uri | |
string | $protocol |
auto_link( $str, $type = 'both', $popup = FALSE) : string
Auto-linker
Automatically links URL and Email addresses. Note: There's a bit of extra code here to deal with URLs or emails that end in a period. We'll strip these off and add them after the link.
$str | ||
$type | ||
$popup |
url_title(string $str, string $separator = '-', boolean $lowercase = FALSE) : string
Create URL Title
Takes a "title" string as input and creates a human-friendly URL string with a "separator" string as the word separator.
string | $str | Input string |
string | $separator | Word separator (usually '-' or '_') |
boolean | $lowercase | Whether to transform the output string to lowercase |
redirect(string $uri = '', string $method = 'auto', integer $code = NULL) : void
Header Redirect
Header redirect in two flavors For very fine grained control over headers, you could use the Output Library's set_header() function.
string | $uri | URL |
string | $method | Redirect method 'auto', 'location' or 'refresh' |
integer | $code | HTTP Response status code |