PHP Class _WPLib_Html_Helpers, wplib

Provide an HTML Helper class for WPLib. Basically, this class contributes static methods to the WPLib class using magic methods.
Inheritance: extends WPLib_Helper_Base
Mostra file Open project: wplib/wplib Class Usage Examples

Public Methods

Method Description
get_html_attributes_html ( string[] | string $attributes = [] ) : string Return a string of one of more '
  • ' elements given a list of attributes
  • get_html_li_element_html ( string $element_text, array $args = [] ) : string Returns one or more HTML
  • elements
  • get_html_li_elements_html ( string[] $li_elements, array $args = [] ) : string Returns one or more HTML
  • elements
  • get_html_ordered_list_html ( string[] $li_elements, array $args = [] ) : string Returns an HTML Ordered List of
  • elements
  • get_html_unordered_list_html ( string[] $li_elements, array $args = [] ) : string Returns an HTML Unordered List of
  • elements
  • get_img ( string $src, array $args = [] ) : string Create a take with URL and optional attributes.
    get_link ( string $href, string $link_text, array $args = [] ) : string Create a hyperlink with URL, Link Text and optional attributes.
    on_load ( )
    sanitize_html_attributes ( string[] | string $attributes ) : string[] Sanitize one or more HTML attributes
    sanitize_html_name ( string $name ) : string Sanitize the name of an HTML attribute or element
    the_html_attributes_html ( string[] | string $attributes = [] ) : string Output a string of one of more '
  • ' elements given a list of attributes
  • the_html_li_elements_html ( string[] $li_elements, array $args = [] ) : string Outputs one or more HTML
  • elements
  • the_html_ordered_list_html ( string[] $li_elements, array $args = [] ) : string Returns an HTML Ordered List of
  • elements
  • the_html_unordered_list_html ( string[] $li_elements, array $args = [] ) : string Returns an HTML Unordered List of
  • elements
  • the_img ( string $src, array $args = [] ) : string Create a hyperlink with URL, Link Text and optional title text.
    the_link ( string $href, string $link_text, array $args = [] ) : string Output a hyperlink with URL, Link Text and optional title text.

    Private Methods

    Method Description
    _get_html_list_html ( string $list_element, string[] $li_elements, array $args = [] ) : string Returns an HTML List of
  • elements, Ordered or Unordered
  • Method Details

    get_html_attributes_html() static public method

    Return a string of one of more '
  • ' elements given a list of attributes
  • static public get_html_attributes_html ( string[] | string $attributes = [] ) : string
    $attributes string[] | string An associate array or URL parameter formatted string of HTML attributes.
    return string

    get_html_li_element_html() static public method

    Returns one or more HTML
  • elements
  • static public get_html_li_element_html ( string $element_text, array $args = [] ) : string
    $element_text string
    $args array { @type string $before @type string $before_text @type string[]|string $attributes @type string $class @type string $after_text @type string $after @type callable $filter @type mixed $index }
    return string

    get_html_li_elements_html() static public method

    Returns one or more HTML
  • elements
  • static public get_html_li_elements_html ( string[] $li_elements, array $args = [] ) : string
    $li_elements string[]
    $args array { @type string $before @type string $before_li @type string $before_text @type string[]|string $attributes @type string $class @type string $after_text @type string $after_li @type string $after @type callable $filter }
    return string

    get_html_ordered_list_html() static public method

    Returns an HTML Ordered List of
  • elements
  • static public get_html_ordered_list_html ( string[] $li_elements, array $args = [] ) : string
    $li_elements string[]
    $args array { @type string $before @type string $class @type string[]|string $attributes @type string $before_elements @type string $before_li @type string $li_class @type string[]|string $li_attributes @type string $before_text @type string $after_text @type string $after_li @type string $after_elements @type string $after @type callable $filter }
    return string

    get_html_unordered_list_html() static public method

    Returns an HTML Unordered List of
  • elements
  • static public get_html_unordered_list_html ( string[] $li_elements, array $args = [] ) : string
    $li_elements string[]
    $args array { @type string $before @type string $class @type string[]|string $attributes @type string $before_elements @type string $before_li @type string $li_class @type string[]|string $li_attributes @type string $before_text @type string $after_text @type string $after_li @type string $after_elements @type string $after @type callable $filter }
    return string

    get_img() static public method

    Create a take with URL and optional attributes.
    static public get_img ( string $src, array $args = [] ) : string
    $src string
    $args array { @type string $before @type string $class @type string $alt_text @type string $fragment @type string $onclick @type string[]|string $attributes @type string $after }
    return string

    sanitize_html_attributes() static public method

    Sanitize one or more HTML attributes
    static public sanitize_html_attributes ( string[] | string $attributes ) : string[]
    $attributes string[] | string An associate array or URL parameter formatted string of HTML attributes.
    return string[]

    sanitize_html_name() static public method

    Sanitize the name of an HTML attribute or element
    See also: http://stackoverflow.com/a/13287707
    static public sanitize_html_name ( string $name ) : string
    $name string
    return string

    the_html_attributes_html() static public method

    Output a string of one of more '
  • ' elements given a list of attributes
  • static public the_html_attributes_html ( string[] | string $attributes = [] ) : string
    $attributes string[] | string An associate array or URL parameter formatted string of HTML attributes.
    return string

    the_html_li_elements_html() static public method

    Outputs one or more HTML
  • elements
  • static public the_html_li_elements_html ( string[] $li_elements, array $args = [] ) : string
    $li_elements string[]
    $args array { @type string $before @type string $before_li @type string[]|string $attributes @type string $class @type string $after_li @type string $after @type callable $filter }
    return string

    the_html_ordered_list_html() static public method

    Returns an HTML Ordered List of
  • elements
  • static public the_html_ordered_list_html ( string[] $li_elements, array $args = [] ) : string
    $li_elements string[]
    $args array { @type string $before @type string $class @type string[]|string $attributes @type string $before_elements @type string $before_li @type string $li_class @type string[]|string $li_attributes @type string $before_text @type string $after_text @type string $after_li @type string $after_elements @type string $after @type callable $filter }
    return string

    the_html_unordered_list_html() static public method

    Returns an HTML Unordered List of
  • elements
  • static public the_html_unordered_list_html ( string[] $li_elements, array $args = [] ) : string
    $li_elements string[]
    $args array { @type string $before @type string $class @type string[]|string $attributes @type string $before_elements @type string $before_li @type string $li_class @type string[]|string $li_attributes @type string $before_text @type string $after_text @type string $after_li @type string $after_elements @type string $after @type callable $filter }
    return string

    the_img() static public method

    Create a hyperlink with URL, Link Text and optional title text.
    static public the_img ( string $src, array $args = [] ) : string
    $src string
    $args array { @type string $before @type string $class @type string $alt_text @type string $fragment @type string $onclick @type string[]|string $attributes @type string $after }
    return string