helpers/html – Kohana API 2.3 Documentation

system/helpers/html.php

Class: html_Core

class html_Core

HTML helper class.


Methods

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 :: anchor

public static function anchor

Create HTML link anchors.

Parameters:

string uri
URL or URI string
string title
(NULL) link text
array attributes
(NULL) HTML anchor attributes
string protocol
(NULL) 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
(NULL) link text
array attributes
(NULL) HTML anchor attributes
string protocol
(NULL) 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 :: anchor_array

public static function anchor_array

Create an array of anchors from an array of link/title pairs.

Parameters:

array array
link/title pairs

Return: array


html_Core :: email

public static function email

Generates an obfuscated version of an email address.

Parameters:

string email
email address

Return: string


html_Core :: mailto

public static function mailto

Creates an email anchor.

Parameters:

string email
email address to send to
string title
(NULL) link text
array attributes
(NULL) 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 :: meta

public static function meta

Creates a meta tag.

Parameters:

string or array tag
tag name, or an array of tags
string value
(NULL) tag "content" value

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 src
(NULL) image source, or an array of attributes
string or array alt
(NULL) image alt attribute, or an array of attributes
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