Yii 2: The Fast, Secure and Professional PHP Framework
BSD 3-Clause "New" or "Revised" License
14.24k
stars
6.91k
forks
source link
registerJsFile with argument depends set does not use the position argument (it will always default to POS_END) #18192
Closed
mikkelcp1 closed 4 years ago
What steps will reproduce the problem?
$this->registerJsFile('@web/js/report-cards/colpo/summary/summary-chart.js', ['position' => \yii\web\View::POS_HEAD, 'depends' => [app\assets\HighChartsHeadAsset::className()]]);
What is the expected result?
The file '@web/js/report-cards/colpo/summary/summary-chart.js' should be included in the head (POS_HEAD)
What do you get instead?
The file '@web/js/report-cards/colpo/summary/summary-chart.js' is included in at the end of body (POS_END)
Additional info
See comment on pull: https://github.com/yiisoft/yii2/pull/16826#pullrequestreview-451928486
Fix;