Skip to main content Link Search Menu Expand Document (external link)

Avoid Mootools Loading

Any extension that does not require the use of mootools should be reviewed for the following method calls and updated where possible to ensure mootools is not loaded by our code.

The methods on the left will load mootools as a side effect and should be replaced with the methods on the right

Also note the change in class name. JHtml should be replaced with \Joomla\CMS\HTML\HTMLHelper. In the chart, the right column assumes the presence of use Joomla\CMS\HTML\HTMLHelper; at the top of the file as per PSR-12 standards. See Joomla 3.8+ class references for more information on Joomla class references.

Old Method Replacement
JHtml:_(‘behavior.framework’) HTMLHelper::_(‘jquery.framework’)
JHtml::_('behavior.tree') No known replacement
Panel Sliders
JHtml::_(‘sliders.start’)
JHtml::_(‘sliders.panel’)
JHtml::_(‘sliders.end’)
HTMLHelper::_(‘bootstrap.addSlide’)
HTMLHelper::_(‘boostrap.endSlide’)
Tabs
JHtml::_(‘tabs.start’)
JHtml::_(‘tabs.panel’)
JHtml::_(‘tabs.end’)
HTMLHelper::_(‘bootstrap.startTabSet’)
HTMLHelper::_(‘bootstrap.addTab’)
HTMLHelper::_(‘bootstrap.endTab’)
HTMLHelper::_(‘bootstrap.endTabSet’)
Tooltips
JHtml::_(‘behavior.tooltip’) HTMLHelper::_(‘bootstrap.tooltip’)
Modals
JHtml::_(‘behavior.modal’)
JHtml::_(‘bootstrap.modal’)
HTMLHelper::_(‘bootstrap.renderModal’)
Forms
JHtml::_('behavior.formvalidation') HTMLHelper::_('behavior.formvalidator');

While bootstrap.modal doesn’t load mootools, it’s included here because it has been deprecated and should be replaced with bootstrap.renderModal.


Copyright © 2020-2022 Joomlashack. License GPL