Details
Description
Hi,
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
$this->headScript()->appendFile('somefile.js').
$this->headScript()->appendFile('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...?
Take care...
Issue Links
| This issue is duplicated by: | ||||
| ZF-2690 | Unique CSS, javascript... files in head helpers |
|
|
|
I just looked at what I submitted and I must have inadvertently introduced some strikethrough markup. It wasn't intended, so please ignore the fact that some text has strikethrough format.
Sorry. :-|