ZF-2426: New Zend_View placeholders allow duplicates...
I have just recently begun to use one of the more recent snapshots so that I could start to use Zend_Layout and the new, related functionality. It's great so far, by the way.
But, I've got a problem with some of it....
I have only observed it when using one of the new "concrete placeholder implementations": HeadScript. Whenever I append a new file, it's possible that two entries are added. That really bugs me.
What I'm trying to do is to take advantage of the new features by only adding script files when and where I need them, without concern for what's already included. On the positive side, it works great in that I'm getting what I need quite simply. But, when I look at the source, I sometimes see duplicate entries. That is, one view script will need somefile.js, and so it calls ``` Now, when the request completes and I view the source, I see two references listed for somefile.js. :-|
Can one prevent this? I've poked around a bit through the few examples "out and about" as well as the snapshot docs, the source, and php.net's ArrayObject documentation (which is a little on the light side). I wasn't able to find anything, but perhaps I've missed it.
Is it bad...? I have to admit, I don't know what it would mean to have the same file referenced more than once. Is there a need for this? Will the browser see that it's already fetched the first one and then ignore the second? Or will it go after both?
So...I would prefer to see HeadScript automatically ignore duplicates. If that's the default and there's good reason to allow duplicates sometimes, then that could be configurable. Or, the opposite: duplicates are allowed by default, but ignoring them could be configurable.
What does everyone else think about the whole thing...?