JHtmlBootstrap
Utility class for Bootstrap elements.
since |
3.0 |
---|---|
package |
Joomla.Libraries |
Methods
addPanel
Begins the display of a new tab content panel.
addPanel(string $selector, string $id) : string
since |
3.0 |
---|---|
deprecated |
4.0 Use JHtml::_('bootstrap.addTab') instead. |
Arguments
- $selector
string
Identifier of the panel.- $id
string
The ID of the div element
Response
string
HTML to start a new panel
addSlide
Begins the display of a new accordion slide.
addSlide(string $selector, string $text, string $id, string $class = '') : string
since |
3.0 |
---|
Arguments
- $selector
string
Identifier of the accordion group.- $text
string
Text to display.- $id
string
Identifier of the slide.- $class
string
Class of the accordion group.
Response
string
HTML to add the slide
addTab
Begins the display of a new tab content panel.
addTab(string $selector, string $id, string $title) : string
since |
3.1 |
---|
Arguments
- $selector
string
Identifier of the panel.- $id
string
The ID of the div element- $title
string
The title text for the new UL tab
Response
string
HTML to start a new panel
affix
Add javascript support for the Bootstrap affix plugin
affix(string $selector = 'affix', array $params = array()) : void
since |
3.1 |
---|---|
deprecated |
4.0 Bootstrap 4.0 dropped this so will Joomla. |
Arguments
- $selector
string
Unique selector for the element to be affixed.- $params
array
An array of options. Options for the affix plugin can be:- offset number|function|object Pixels to offset from screen when calculating position of scroll. If a single number is provided, the offset will be applied in both top and left directions. To listen for a single direction, or multiple unique offsets, just provide an object offset: { x: 10 }. Use a function when you need to dynamically provide an offset (useful for some responsive designs).
alert
Add javascript support for Bootstrap alerts
alert(string $selector = 'alert') : void
since |
3.0 |
---|
Arguments
- $selector
string
Common class for the alerts
button
Add javascript support for Bootstrap buttons
button(string $selector = 'button') : void
since |
3.1 |
---|
Arguments
- $selector
string
Common class for the buttons
carousel
Add javascript support for Bootstrap carousels
carousel(string $selector = 'carousel', array $params = array()) : void
since |
3.0 |
---|
Arguments
- $selector
string
Common class for the carousels.- $params
array
An array of options for the carousel. Options for the carousel can be:- interval number The amount of time to delay between automatically cycling an item. If false, carousel will not automatically cycle.
- pause string Pauses the cycling of the carousel on mouseenter and resumes the cycling of the carousel on mouseleave.
dropdown
Add javascript support for Bootstrap dropdowns
dropdown(string $selector = 'dropdown-toggle') : void
since |
3.0 |
---|
Arguments
- $selector
string
Common class for the dropdowns
endAccordion
Close the current accordion
endAccordion() : string
since |
3.0 |
---|
Response
string
HTML to close the accordian
endPane
Close the current tab pane
endPane() : string
since |
3.0 |
---|---|
deprecated |
4.0 Use JHtml::_('bootstrap.endTabSet') instead. |
Response
string
HTML to close the pane
endPanel
Close the current tab content panel
endPanel() : string
since |
3.0 |
---|---|
deprecated |
4.0 Use JHtml::_('bootstrap.endTab') instead. |
Response
string
HTML to close the pane
endSlide
Close the current slide
endSlide() : string
since |
3.0 |
---|
Response
string
HTML to close the slide
endTab
Close the current tab content panel
endTab() : string
since |
3.1 |
---|
Response
string
HTML to close the pane
endTabSet
Close the current tab pane
endTabSet() : string
since |
3.1 |
---|
Response
string
HTML to close the pane
framework
Method to load the Bootstrap JavaScript framework into the document head
framework(mixed $debug = null) : void
If debugging mode is on an uncompressed version of Bootstrap is included for easier debugging.
since |
3.0 |
---|
Arguments
- $debug
mixed
Is debugging mode on? [optional]
loadCss
Loads CSS files needed by Bootstrap
loadCss(boolean $includeMainCss = true, string $direction = 'ltr', array $attribs = array()) : void
since |
3.0 |
---|
Arguments
- $includeMainCss
boolean
If true, main bootstrap.css files are loaded- $direction
string
rtl or ltr direction. If empty, ltr is assumed- $attribs
array
Optional array of attributes to be passed to JHtml::_('stylesheet')
modal
Add javascript support for Bootstrap modals
modal(string $selector = 'modal', array $params = array()) : void
since |
3.0 |
---|---|
deprecated |
4.0 This method was used by the old renderModal() implementation. Since the new implementation it is unneeded and the broken JS it was injecting could create issues As a case, please see: https://github.com/joomla/joomla-cms/pull/6918 |
Arguments
- $selector
string
The ID selector for the modal.- $params
array
An array of options for the modal. Options for the modal can be:- backdrop boolean Includes a modal-backdrop element.
- keyboard boolean Closes the modal when escape key is pressed.
- show boolean Shows the modal when initialized.
- remote string An optional remote URL to load
popover
Add javascript support for Bootstrap popovers
popover(string $selector = '.hasPopover', array $params = array()) : void
Use element's Title as popover content
since |
3.0 |
---|
Arguments
- $selector
string
Selector for the popover- $params
array
An array of options for the popover. Options for the popover can be: animation boolean apply a css fade transition to the popover html boolean Insert HTML into the popover. If false, jQuery's text method will be used to insert content into the dom. placement string|function how to position the popover - top | bottom | left | right selector string If a selector is provided, popover objects will be delegated to the specified targets. trigger string how popover is triggered - hover | focus | manual title string|function default title value iftitle
tag isn't present content string|function default content value ifdata-content
attribute isn't present delay number|object delay showing and hiding the popover (ms) - does not apply to manual trigger type If a number is supplied, delay is applied to both hide/show Object structure is: delay: { show: 500, hide: 100 } container string|boolean Appends the popover to a specific element: { container: 'body' }
renderModal
Method to render a Bootstrap modal
renderModal(string $selector = 'modal', array $params = array(), string $body = '') : string
since |
3.0 |
---|
Arguments
- $selector
string
The ID selector for the modal.- $params
array
An array of options for the modal. Options for the modal can be:- title string The modal title
- backdrop mixed A boolean select if a modal-backdrop element should be included (default = true) The string 'static' includes a backdrop which doesn't close the modal on click.
- keyboard boolean Closes the modal when escape key is pressed (default = true)
- closeButton boolean Display modal close button (default = true)
- animation boolean Fade in from the top of the page (default = true)
- footer string Optional markup for the modal footer
- url string URL of a resource to be inserted as an
<iframe>
inside the modal body - height string height of the
<iframe>
containing the remote resource - width string width of the
<iframe>
containing the remote resource
- $body
string
Markup for the modal body. Appended after the<iframe>
if the URL option is set
Response
string
HTML markup for a modal
scrollspy
Add javascript support for Bootstrap ScrollSpy
scrollspy(string $selector = 'navbar', array $params = array()) : void
since |
3.0 |
---|
Arguments
- $selector
string
The ID selector for the ScrollSpy element.- $params
array
An array of options for the ScrollSpy. Options for the ScrollSpy can be:- offset number Pixels to offset from top when calculating position of scroll.
startAccordion
Add javascript support for Bootstrap accordions and insert the accordion
startAccordion(string $selector = 'myAccordian', array $params = array()) : string
since |
3.0 |
---|
Arguments
- $selector
string
The ID selector for the tooltip.- $params
array
An array of options for the tooltip. Options for the tooltip can be:-
parent selector If selector then all collapsible elements under the specified parent will be closed when this collapsible item is shown. (similar to traditional accordion behavior)
-
toggle boolean Toggles the collapsible element on invocation
-
active string Sets the active slide during load
-
onShow function This event fires immediately when the show instance method is called.
-
onShown function This event is fired when a collapse element has been made visible to the user (will wait for css transitions to complete).
-
onHide function This event is fired immediately when the hide method has been called.
-
onHidden function This event is fired when a collapse element has been hidden from the user (will wait for css transitions to complete).
-
Response
string
HTML for the accordian
startPane
Creates a tab pane
startPane(string $selector = 'myTab', array $params = array()) : string
since |
3.0 |
---|---|
deprecated |
4.0 Use JHtml::_('bootstrap.startTabSet') instead. |
Arguments
- $selector
string
The pane identifier.- $params
array
The parameters for the pane
Response
string
startTabSet
Creates a tab pane
startTabSet(string $selector = 'myTab', array $params = array()) : string
since |
3.1 |
---|
Arguments
- $selector
string
The pane identifier.- $params
array
The parameters for the pane
Response
string
tooltip
Add javascript support for Bootstrap tooltips
tooltip(string $selector = '.hasTooltip', array $params = array()) : void
Add a title attribute to any element in the form title="title::text"
since |
3.0 |
---|
Arguments
- $selector
string
The ID selector for the tooltip.- $params
array
An array of options for the tooltip. Options for the tooltip can be:- animation boolean Apply a CSS fade transition to the tooltip
- html boolean Insert HTML into the tooltip. If false, jQuery's text method will be used to insert content into the dom.
- placement string|function How to position the tooltip - top | bottom | left | right
- selector string If a selector is provided, tooltip objects will be delegated to the specified targets.
- title string|function Default title value if
title
tag isn't present - trigger string How tooltip is triggered - hover | focus | manual
- delay integer Delay showing and hiding the tooltip (ms) - does not apply to manual trigger type If a number is supplied, delay is applied to both hide/show Object structure is: delay: { show: 500, hide: 100 }
- container string|boolean Appends the popover to a specific element: { container: 'body' }
tooltipExtended
Loads js and css files needed by Bootstrap Tooltip Extended plugin
tooltipExtended(boolean $extended = true) : void
since |
3.6 |
---|---|
deprecated |
4.0 No replacement, use Bootstrap tooltips. |
Arguments
- $extended
boolean
If true, bootstrap-tooltip-extended.js and .css files are loaded
typeahead
Add javascript support for Bootstrap typeahead
typeahead(string $selector = '.typeahead', array $params = array()) : void
since |
3.0 |
---|---|
deprecated |
4.0 Bootstrap 4.0 dropped this so will Joomla. |
Arguments
- $selector
string
The selector for the typeahead element.- $params
array
An array of options for the typeahead element. Options for the tooltip can be:- source array, function The data source to query against. May be an array of strings or a function. The function is passed two arguments, the query value in the input field and the process callback. The function may be used synchronously by returning the data source directly or asynchronously via the process callback's single argument.
- items number The max number of items to display in the dropdown.
- minLength number The minimum character length needed before triggering autocomplete suggestions
- matcher function The method used to determine if a query matches an item. Accepts a single argument, the item against which to test the query. Access the current query with this.query. Return a boolean true if query is a match.
- sorter function Method used to sort autocomplete results. Accepts a single argument items and has the scope of the typeahead instance. Reference the current query with this.query.
- updater function The method used to return selected item. Accepts a single argument, the item and has the scope of the typeahead instance.
- highlighter function Method used to highlight autocomplete results. Accepts a single argument item and has the scope of the typeahead instance. Should return html.
Properties
loaded
Array containing information for loaded files
since |
3.0 |
---|
Type(s)
array