Back to Jquery class

Method framework

public static void
framework
(mixed $noConflict = true, mixed $debug = null, mixed $migrate = false)
Method to load the jQuery JavaScript framework into the document head
Parameters
  • bool $noConflict True to load jQuery in noConflict mode [optional]
  • mixed $debug Is debugging mode on? [optional]
  • bool $migrate True to enable the jQuery Migrate plugin
Returns
  • void
Since
  • 3.0
Deprecated
  • 5.0
Class: Jquery
Project: Joomla

Method framework - Source code

/**
 * Method to load the jQuery JavaScript framework into the document head
 *
 * If debugging mode is on an uncompressed version of jQuery is included for easier debugging.
 *
 * @param   boolean  $noConflict  True to load jQuery in noConflict mode [optional]
 * @param   mixed    $debug       Is debugging mode on? [optional]
 * @param   boolean  $migrate     True to enable the jQuery Migrate plugin
 *
 * @return  void
 *
 * @since   3.0
 *
 * @deprecated 5.0  Use Joomla\CMS\WebAsset\WebAssetManager::useAsset();
 */
public static function framework($noConflict = true, $debug = null, $migrate = false)
{
    $wa = Factory::getApplication()->getDocument()->getWebAssetManager();
    $wa->useScript('jquery');
    // Check if we are loading in noConflict
    if ($noConflict) {
        $wa->useScript('jquery-noconflict');
    }
    // Check if we are loading Migrate
    if ($migrate) {
        $wa->useScript('jquery-migrate');
    }
}