Skip to content

How to add CSS and Javascript to Your Joomla Extension

When creating a quality Joomla extension you will place your styles and javascript codes on seperate files.

Then here is the way to add those files in to the joomla extension the proper way.

$document = JFactory::getDocument();
$document->addStyleSheet(JURI::root().’mod_name/css/stylesheet.css’);
$document->addScript(JURI::root(). ‘mod_name/js/script.js’);

Table of Contents

Please enable JavaScript in your browser to complete this form.
Name