如何在Zend Framewok中追加js文件时定义自定义属性?

mrN*_*mrN 8 javascript attributes zend-framework

我正在尝试在我的zf应用程序中实现内容流.在加载其属性时,需要定义一个额外的属性.

<script type="text/javascript" src=".." load="white"></script>
Run Code Online (Sandbox Code Playgroud)

要使用zf来解释这个,我试过了

$this -> headScript() -> appendFile("my/path/to/contentflow.js","text/javascript", array("load" => "white")); 
Run Code Online (Sandbox Code Playgroud)

但它不起作用.

这该怎么做?

Sta*_*arx 16

Zend Framework不允许这样的随机属性.如果你真的必须使用它们,你必须使用它们

$this -> headScript() -> setAllowArbitraryAttributes(true);
Run Code Online (Sandbox Code Playgroud)