diff --git a/src/View/Helper/HeadScript.php b/src/View/Helper/HeadScript.php index 46dab31..9423cac 100644 --- a/src/View/Helper/HeadScript.php +++ b/src/View/Helper/HeadScript.php @@ -154,6 +154,7 @@ private function generateScripts(array $items, $jsDir, $minifiedFile, $indent) $scripts[] = $this->itemToString($item, $indent, $escapeStart, $escapeEnd); } - return $scripts; + // Make sure the scripts are in the correct order. + return array_reverse($scripts, true); } }