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())
以上就介紹了ZendViewHelperHeadscript零件使用方法,包含了方面的內容,希望對PHP教學有興趣的朋友有幫助。