Prepend scripts in layout
authorJurian Sluiman <jurian@soflomo.com>
Sun, 29 Jul 2012 09:39:18 +0000 (11:39 +0200)
committerJurian Sluiman <jurian@soflomo.com>
Sun, 29 Jul 2012 09:39:18 +0000 (11:39 +0200)
When view scripts append scripts based on jQuery, they are registered last
so jQuery is already loaded.

module/Application/view/layout/layout.phtml

index a26b180..47812ed 100644 (file)
@@ -14,8 +14,8 @@
                     ->prependStylesheet($this->basePath() . '/css/bootstrap.min.css') ?>
 
     <!-- Scripts -->
-    <?php echo $this->headScript()->appendFile($this->basePath() . '/js/html5.js', 'text/javascript', array('conditional' => 'lt IE 9',))
-                                  ->appendFile($this->basePath() . '/js/jquery-1.7.2.min.js') ?>
+    <?php echo $this->headScript()->prependFile($this->basePath() . '/js/html5.js', 'text/javascript', array('conditional' => 'lt IE 9',))
+                                  ->prependFile($this->basePath() . '/js/jquery-1.7.2.min.js') ?>
 
   </head>