HeadScript部件是用于在网页开始引入js文件或者js代码。其用于引入和设置js代码的方法有:
appendFile($src, $type = ’text/javascript’, $attrs = array()) offsetSetFile($index, $src, $type = ’text/javascript’, $attrs = array()) prependFile($src, $type = ’text/javascript’, $attrs = array()) setFile($src, $type = ’text/javascript’, $attrs = array()) appendScript($script, $type = ’text/javascript’, $attrs = array()) offsetSetScript($index, $script, $type = ’text/javascript’, $attrs =array()) prependScript($script, $type = ’text/javascript’, $attrs = array()) setScript($script, $type = ’text/javascript’, $attrs = array())
以上就介绍了Zend\View\Helper\Headscript部件使用方法,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。