Hello,
I try to place a JavaScript tag in a particular order using Zend_Layout.
I have this files:
layout.hml
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<?php
echo $this->headScript()
->appendFile('/style/fistScript.js')
?>
</head>
<body>
<?php echo $this->layout()->content ?>
</body>
</html>
index.phtml
<?php
$this->headTitle('New Zend Framework Project');
$this->headScript()
->offsetSetFile(100, '/style/teste2.js');
?>
Hello, world!
When I run its generate this page:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="/style/lastScript.js"></script>
<script type="text/javascript"
src="/style/firstScript.js"></script>
</head>
<body>
Hello, world!
</body>
</html>
The probleme is that LastScript.js came before the firstScript.js, in source
gerenated.
With $this->headScript()->offsetSetFile, the lastScript.js must be the last
script tag in generate source.
How can I do to fistScript.js came first of lastScript.js?
Thanks.
--
View this message in context:
http://www.nabble.com/How-to-place-a-JavaScript-tag-in-a-particular-order-with-Zend_Layout-headScript-helper-tp19512901p19512901.html
Sent from the Zend Framework mailing list archive at Nabble.com.