Skip to content
This repository was archived by the owner on Jan 1, 2020. It is now read-only.

Commit 78a8ead

Browse files
committed
Prepend CSS and JS files
Since rendering occurs depth-first in ZF, the CSS and JS that pages add usually need to override the application-level assets. As such, the layout needs to *prepend* its assets to ensure order is correct.
1 parent 4f2100e commit 78a8ead

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

module/Application/view/layout/layout.phtml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212

1313
<!-- Le styles -->
1414
<?= $this->headLink(['rel' => 'shortcut icon', 'type' => 'image/vnd.microsoft.icon', 'href' => $this->basePath() . '/img/favicon.ico'])
15-
->appendStylesheet($this->basePath('css/bootstrap.min.css'))
16-
->appendStylesheet($this->basePath('css/bootstrap-theme.min.css'))
17-
->appendStylesheet($this->basePath('css/style.css'))
15+
->prependStylesheet($this->basePath('css/bootstrap.min.css'))
16+
->prependStylesheet($this->basePath('css/bootstrap-theme.min.css'))
17+
->prependStylesheet($this->basePath('css/style.css'))
1818
?>
1919

2020
<!-- Scripts -->
2121
<?= $this->headScript()
22-
->appendFile($this->basePath('js/jquery-2.2.4.min.js'))
23-
->appendFile($this->basePath('js/bootstrap.min.js'))
22+
->prependFile($this->basePath('js/jquery-2.2.4.min.js'))
23+
->prependFile($this->basePath('js/bootstrap.min.js'))
2424
?>
2525
</head>
2626
<body>

0 commit comments

Comments
 (0)