zend framework(1.1)将javascript文件附加到页脚?

Is there a out of the box way of loading certain javascripts in the footer of a view script?

This would be particularly useful for such scripts like google analytics, etc.

Or would this require extending $this->headScript() and creating a $this->footScript() ?

use a placeholder in your layout like $this->layout()->footScript and then attach the code you want to the placeholder.
Or you could just use the inlineScript() Helper. The inlineScript helper has the same api is headScript().
The optimum would probably be to use the layout placeholder along with the inlineScript helper.

An Example of the inlineScript helper:

//I use this in some of my controllers, in the predispatch()
$this->view->inlineScript()->setScript(
                "$('audio').mediaelementplayer();");

//then I just attach this to any view (including layout)
<?php echo $this->inlineScript() ?>

Use something like this with a placeholder and you have javascript anywhere.

Using PHP, putting auto_append_file in a php.ini file or .htaccess file may be what you are looking for.

Link: php.net/manual/en/ini.core.php#ini.auto-append-file

If you don't have access to php.ini you can put

php_value auto_append_file "file_to_append.php"

into an .htaccess file.

Keep in mind, however, that this will append it after the closing HTML tags, and therefore invalidate the markup.

I only use this for PHP scripts that don't output anything.