Last active
August 15, 2016 12:29
-
-
Save zaurmag/53d0f4984e1b98aea255845a2f97151d to your computer and use it in GitHub Desktop.
Подключение скриптов в шаблонах Joomla
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Подключение файла JS | |
JHtml::script(JUri::base().'templates/'.$this->template.'/js/js.js', false); | |
$document = JFactory::getDocument(); | |
// Add Javascript | |
$document->addScriptDeclaration(' | |
window.event("domready", function() { | |
alert("An inline JavaScript Declaration"); | |
}); | |
'); | |
// Add styles | |
$style = 'body {' | |
. 'background: #00ff00;' | |
. 'color: rgb(0,0,255);' | |
. '}'; | |
$document->addStyleDeclaration($style); | |
?> | |
Подробнее про подключение скриптов и стилей - http://docs.joomla.org/J3.x:Adding_JavaScript_and_CSS_to_the_page |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment