system/helpers/url.php

Class: url_Core

class url_Core

URL helper class.

url_Core :: base

public static function base

Base URL, with or without the index page.

Parameters:

boolean index
(FALSE) include the index page
boolean protocol
(FALSE) non-default protocol

Return: string


url_Core :: site

public static function site

Fetches a site URL based on a URI segment.

Parameters:

string uri
(string ) site URI to convert
string protocol
(FALSE) non-default protocol

Return: string


url_Core :: current

public static function current

Fetches the current URI.

Parameters:

boolean qs
(FALSE) include the query string

Return: string


url_Core :: title

public static function title

Convert a phrase to a URL-safe title.

Parameters:

string title
phrase to convert
string separator
(string -) word separator (- or _)

Return: string


url_Core :: redirect

public static function redirect

Sends a page redirect header.

by the user, unless their browser does not understand the headers sent.

Parameters:

string uri
(string ) site URI or URL to redirect to
string method
(string 302) HTTP method of redirect

Return: A HTML anchor, but sends HTTP headers. The anchor should never be seen