I currently have a page which renders 6 partial views. The problem that I am now facing is that, because I need to set processOutput to TRUE, jquery is loaded multiple times.
I tried to resolve this by adding
<?php Yii::app()->clientscript->scriptMap['jquery.min.js'] = FALSE; ?>
<?php Yii::app()->clientscript->scriptMap['jquery.js'] = FALSE; ?>
To my partial view. The problem is, that by doing so, jquery doesn't load AT all.
Anyway to resolve this so it will only load once?
You can include following ClientScript mapping in your config file under components array
Also add following to your
<head>
sectionAnd remove anyother manual jquery include in your views. You should be fine.
Change your code to:
With this approach, you can use the asset manager. Example: