November 6, 2011
How to define custom attributes while appending a js file in Zend Framewok?
Question by mrN
I am trying to implement content flow in my zf application. And while loading its attributes, it requires one extra attribute to be defined.
<script type="text/javascript" src=".." load="white"></script>
To interprete this using zf, i tried
$this -> headScript() -> appendFile("my/path/to/contentflow.js","text/javascript", array("load" => "white"));
But its not working.
How to do this?
Answer by Starx
Zend Framework does not allow such random attributes. If you really have to use them, you have to enable them using
$this -> headScript() -> setAllowArbitraryAttributes(true);