Comment ajouter des fichiers de script à l'aide de headScript avec Zend Framework?

Je suis en train d'élaborer une nouvelle application zend framework, et quand j'ai juste codé en dur le headScript section pour ma mise en page.phtml fichier et Bootstrap _initScript méthode, quand on regarde le code source, après ne pas avoir le script chargé... un très étrange résultat.

J'ai obtenu ceci:

<script type="text/javascript">
    //<!--
    /js/jquery-1.8.1.min.js    //-->

Voici ma mise en page.phtml code:

<?php echo $this->doctype(); ?> 
<html>
    <head>
        <?php echo $this->headTitle(); ?>
        <?php echo $this->headLink(); ?>
        <?php echo $this->headScript(); ?>
    </head>
    <body>
        <?php echo $this->layout()->content; ?>
    </body> 
</html>

Voici mon Bootstrap.php code:

protected function _initScript()
{
    $this->view->headScript()
       ->prependScript( "/js/jquery-1.8.1.min.js" );
}

Comme vous pouvez le voir, il est très ordinaire de code!

Quelqu'un pourrait m'aider à trouver ce qu'il se passe ici?

  • Avec un débogueur interactif, vous pouvez le trouver facilement.