User Rating: 2 / 5

Star ActiveStar ActiveStar InactiveStar InactiveStar Inactive
 

Building Media on Joomla Component

Component development might be run or runs javascript and style sheet files that do not exist, create a folder named Joomla system component in the media. 

For example, component hello => media / com_hello. 

And may be create a folder to store the style sheet css js folder to store javascript img folder to store the images. I use the Component

For example, the image file to use JUri :: root () for reference at the Joomla installation.

<?php echo JUri::root().'media/com_hello/img/picture.jpg';?>

 

For example, to call the css files with javascript.

/ / Called Object Document of Joomla. 
$ document = JFactory :: getDocument (); 
/ / Call the javascript file with the command addScript (). 
$ document-> addScript (JUri :: root (). 'media / com_hello / js / script.js'); 
/ / Calls css files with commands addStyleSheet (). 
$ document-> addStyleSheet (JUri :: root (). 'media / com_hello / css / style.css');

 

Chapter 16 - Creating Sidebar Component Development