J
J
jk222014-01-03 14:10:21
Yii
jk22, 2014-01-03 14:10:21

Why is the connection of javascript in the layout in the reverse order?

Why when connecting scripts to layout like this:
<?php Yii::app()->clientScript->registerCoreScript('jquery'); ?>
script type="text/javascript" src="/js/jquery.form.min.js" /script
are they rendered in this (reverse order)?
script type="text/javascript" src="/js/jquery.form.min.js" /script>
script type="text/javascript" src="/assets/e3c853d5/jquery.js" /script

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2014-01-03
Protko @Fesor

Well, how does the asset manager know the dependencies? You either have to register your plugin as well as an asset through the manager, or manually connect jquery. The asset manager simply adds scripts to the end of the head section (in the case of POS_HEAD).
In general, the asset manager in yii is a rotten thing and I think that it only adds to the hemorrhoids and does not help in something. Then look for all these registerCoreScript in a cloud of modules / widgets / components / extensions .... When deploying it is inconvenient, everything happens on the fly, if you have php from Apache and from some user ala www-data, then there may be problems with rights...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question