ZF-2690: Unique CSS, javascript... files in head helpers

Issue Type: Improvement Created: 2008-02-19T15:02:28.000+0000 Last Updated: 2008-03-31T16:10:03.000+0000 Status: Resolved Fix version(s): Reporter: Marco Lijoi (ligio) Assignee: Ralph Schindler (ralph) Tags: - Zend_View

Related issues: - ZF-2426



When you use

echo $this->headScript(); echo $this->headStylesheet();

in template files maybe is right to filter printed content with something like "array_unique". For example:

I'm appending stylesheets in a controller class in this way: $this->view->headLink()->appendStylesheet('style.css'); $this->view->headLink()->appendStylesheet('style2.css');

Then the action in this controller makes a forward to another action where you find this code: $this->view->headLink()->appendStylesheet('style.css');

In the view template I'm using: echo $this->headStylesheet()

Now, the headStylesheet() function will print 2 times the link to "style.css" ! why? I think is better if this function makes a "unique print" of different files. Same "problem" with headScript() and headMeta() with same keys

try for example:

$this->view->headMeta()->appendName('robots', 'index, follow'); $this->view->headMeta()->appendName('robots', 'noindex, nofollow');

$this->view->headScript()->appendFile('/js/prototype.js'); $this->view->headScript()->appendFile('/js/prototype.js');


Posted by Jon Whitcraft (sidhighwind) on 2008-02-20T07:37:34.000+0000

Mark as duplicat of ZF-2426

Posted by Jordan Ryan Moore (jordanryanmoore) on 2008-02-20T13:52:21.000+0000

Fixed in trunk.

Posted by Wil Sinclair (wil) on 2008-03-31T16:10:03.000+0000

Please evaluate and categorize as necessary.

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.