PHP Class Bootstrap\View\Helper\BootstrapHtmlHelper

Inheritance: extends Cake\View\Helper\HtmlHelper, use trait BootstrapTrait
Show file Open project: holt59/cakephp3-bootstrap3-helpers Class Usage Examples

Protected Properties

Property Type Description
$_defaultConfig

Public Methods

Method Description
alert ( $text, $type = null, $options = [] ) Create a Twitter Bootstrap style alert block, containing text.
badge ( $text, $options = [] ) Create a Twitter Bootstrap span badge.
dropdown ( array $menu = [], array $options = [] ) Create & return a twitter bootstrap dropdown menu.
faIcon ( $icon, $options = [] ) Create a font awesome icon.
getCrumbList ( array $options = [], $startText = false ) Get crumb lists in a HTML list, with bootstrap like style.
glIcon ( $icon, $options = [] ) Create a glyphicon icon.
icon ( $icon, $options = [] ) Create a glyphicon or font awesome icon depending on $this->_useFontAwesome.
label ( $text, $type = null, $options = [] ) Create a Twitter Bootstrap span label.
progress ( $widths, $options = [] ) Create a Twitter Bootstrap style progress bar.
splicedRows ( $breakIndex, array $data, callable $determineContent ) : string Create a formatted collection of elements while maintaining proper bootstrappy markup. Useful when displaying, for example, a list of products that would require more than the maximum number of columns per row.
tooltip ( $text, $tooltip, $options = [] ) : The Create a Twitter Bootstrap style tooltip.

Method Details

alert() public method

Create a Twitter Bootstrap style alert block, containing text.
public alert ( $text, $type = null, $options = [] )
$text The alert text
$type The type of the alert
$options Options that will be passed to Html::div method The second parameter may either be $type or $options (in this case, the third parameter is useless, and the label type can be specified in the $options array). Available BootstrapHtml options: - type: string, type of alert (default, error, info, success ; useless if $type is specified)

badge() public method

Create a Twitter Bootstrap span badge.
public badge ( $text, $options = [] )

dropdown() public method

Create & return a twitter bootstrap dropdown menu.
public dropdown ( array $menu = [], array $options = [] )
$menu array HTML tags corresponding to menu options (which will be wrapped into
  • tag). To add separator, pass 'divider'.
  • $options array Attributes for the wrapper (change it with tag)

    faIcon() public method

    Create a font awesome icon.
    public faIcon ( $icon, $options = [] )
    $icon Name of the icon.

    getCrumbList() public method

    Get crumb lists in a HTML list, with bootstrap like style.
    public getCrumbList ( array $options = [], $startText = false )
    $options array Options for list
    $startText Text to insert before list Unusable options: - Separator

    glIcon() public method

    Create a glyphicon icon.
    public glIcon ( $icon, $options = [] )
    $icon Name of the icon.

    icon() public method

    Create a glyphicon or font awesome icon depending on $this->_useFontAwesome.
    public icon ( $icon, $options = [] )
    $icon Name of the icon.

    label() public method

    Create a Twitter Bootstrap span label.
    public label ( $text, $type = null, $options = [] )

    progress() public method

    Create a Twitter Bootstrap style progress bar.
    public progress ( $widths, $options = [] )
    $widths - The width (in %) of the bar (style primary, without display) - An array of bar, with (for each bar) : - width (only field required) - type (primary, info, danger, success, warning, default is primary) - min (integer, default 0) - max (integer, default 100) - display (boolean, default false, for text display)
    $options Options that will be passed to Html::div method (only for main div) If $widths is only a integer (first case), $options may contains value for the fields specified above. Available BootstrapHtml options: - striped: boolean, specify if progress bar should be striped - active: boolean, specify if progress bar should be active

    splicedRows() public method

    Create a formatted collection of elements while maintaining proper bootstrappy markup. Useful when displaying, for example, a list of products that would require more than the maximum number of columns per row.
    public splicedRows ( $breakIndex, array $data, callable $determineContent ) : string
    $breakIndex int|string divisible index that will trigger a new row
    $data array array collection of data used to render each column
    $determineContent callable callable a callback that will be called with the data required to render an individual column
    return string

    tooltip() public method

    Create a Twitter Bootstrap style tooltip.
    public tooltip ( $text, $tooltip, $options = [] ) : The
    $text The HTML tag inner text.
    $tooltip The tooltip text.
    $options
    return The text wrapped in the specified tag with a tooltip.

    Property Details

    $_defaultConfig protected property

    protected $_defaultConfig