Answer the question
In order to leave comments, you need to log in
Spring MVC, JSP, including css/js packages?
Yii has the ability to include css/js in batches.
We specify in the config which packages, what they contain and what they depend on.
'main' => array(<br>
'baseUrl' => '/templates/',<br>
'css' => array('css/s/main.css', 'css/s/main-responsive.css'),<br>
'js' => array('js/s/main.js'),<br>
'depends' => array('jquery', 'bootstrap'),<br>
),<br>
'bootstrap' => array(<br>
'baseUrl' => '/templates/',<br>
'js' => array('js/bootstrap.min.js'),<br>
'css' => array('css/bootstrap.min.css','css/bootstrap.fix.css'),<br>
'depends' => array('jquery'),<br>
),<br>
'font-awesome' => array(<br>
'baseUrl' => '/templates/',<br>
'css' => array('css/fontawesome/fontawesome.css'),<br>
),<br>
'jquery' => array(<br>
'baseUrl' => '/templates/',<br>
'js' => array('js/jquery-1.8.3.min.js'),<br>
);<br>
Yii::app()->getClientScript()->registerPackage('main');<br>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question