system/helpers/html.php
Class: html_Core
class html_Core
HTML helper class.
html_Core :: specialchars
public static function specialchars
Convert special characters to HTML entities
Parameters:
- string str
- string to convert
- boolean double_encode
- (TRUE) encode existing entities
Return: string
html_Core :: query_string
public static function query_string
Creates an HTTP query string from an array. Deprecated.
Parameters:
- array array
- array of data to convert to string
Return: string
html_Core :: anchor
public static function anchor
Create HTML link anchors.
Parameters:
- string uri
- URL or URI string
- string title
- (FALSE) link text
- array attributes
- (FALSE) HTML anchor attributes
- string protocol
- (FALSE) non-default protocol, eg: https
Return: string
html_Core :: file_anchor
public static function file_anchor
Creates an HTML anchor to a file.
Parameters:
- string file
- name of file to link to
- string title
- (FALSE) link text
- array attributes
- (FALSE) HTML anchor attributes
- string protocol
- (FALSE) non-default protocol, eg: ftp
Return: string
html_Core :: panchor
public static function panchor
Similar to anchor, but with the protocol parameter first.
Parameters:
- string protocol
- link protocol
- string uri
- URI or URL to link to
- string title
- (FALSE) link text
- array attributes
- (FALSE) HTML anchor attributes
Return: string
html_Core :: mailto
public static function mailto
Creates a email anchor.
Parameters:
- string email
- email address to send to
- string title
- (FALSE) link text
- array attributes
- (FALSE) HTML anchor attributes
Return: string
html_Core :: breadcrumb
public static function breadcrumb
Generate a "breadcrumb" list of anchors representing the URI.
Parameters:
- array segments
- (NULL) segments to use as breadcrumbs, defaults to using Router::$segments
Return: string
html_Core :: stylesheet
public static function stylesheet
Creates a stylesheet link.
Parameters:
- string or array style
- filename, or array of filenames to match to array of medias
- string or array media
- (FALSE) media type of stylesheet, or array to match filenames
- boolean index
- (FALSE) include the index_page in the link
Return: string
html_Core :: link
public static function link
Creates a link tag.
Parameters:
- string or array href
- filename
- string or array rel
- relationship
- string or array type
- mimetype
- string suffix
- (FALSE) specifies suffix of the file
- string or array media
- (FALSE) specifies on what device the document will be displayed
- boolean index
- (FALSE) include the index_page in the link
Return: string
html_Core :: script
public static function script
Creates a script link.
Parameters:
- string or array script
- filename
- boolean index
- (FALSE) include the index_page in the link
Return: string
html_Core :: image
public static function image
Creates a image link.
Parameters:
- string or array attr
- (NULL) array of html attributes, or an image name
- boolean index
- (FALSE) include the index_page in the link
Return: string
html_Core :: attributes
public static function attributes
Compiles an array of HTML attributes into an attribute string.
Parameters:
- string or array attrs
- array of attributes
Return: string