How to add CSS and Javascript to Your Joomla Extension

 In blog

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’);
Recent Posts

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Start typing and press Enter to search