Issue:
- Zend Framework placeholder (headTitle, headMeta, headLink, headScript, headStyle, inlineScript) creates twice or multiple title/meta/link/script tags in HTML.
- Duplicated title/meta/link/script tags generated from Zend Framework placeholder.
- e.g.:
source:
<?php echo $this->headScript()->appendFile("/scripts/global.js") ?> <?php echo $this->headScript()->appendFile("/scripts/main.js") ?>
output:
<script src="/scripts/global.js" type="text/javascript"></script> <script src="/scripts/global.js" type="text/javascript"></script> <script src="/scripts/main.js" type="text/javascript"></script>
Reason:
- Echo will output all elements in a placeholder.
Solution:
- Echo only once for each placeholder.
- e.g.:
<?php $this->headLink()->appendStylesheet('/styles/global.css') ?> <?php $this->headLink()->appendStylesheet('/styles/main.css') ?> <?php echo $this->headLink() ?> <?php $this->headScript()->appendFile("/scripts/global.js") ?> <?php $this->headScript()->appendFile("/scripts/main.js") ?> <?php echo $this->headScript() ?>
Basically details! You actually solved the particular query My partner and i posted on StackOverflow.
Comment by wildstar — July 8, 2014 @ 10:04 am