Ver Fonte

ZF-10345: allow specifying id attribute in headLink helper

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@23242 44c647ce-9c0f-0410-b52a-842ac1e357ba
matthew há 15 anos atrás
pai
commit
4a20161c72

+ 1 - 1
library/Zend/View/Helper/HeadLink.php

@@ -40,7 +40,7 @@ class Zend_View_Helper_HeadLink extends Zend_View_Helper_Placeholder_Container_S
      *
      *
      * @var array
      * @var array
      */
      */
-    protected $_itemKeys = array('charset', 'href', 'hreflang', 'media', 'rel', 'rev', 'type', 'title', 'extras');
+    protected $_itemKeys = array('charset', 'href', 'hreflang', 'id', 'media', 'rel', 'rev', 'type', 'title', 'extras');
 
 
     /**
     /**
      * @var string registry key
      * @var string registry key

+ 9 - 0
tests/Zend/View/Helper/HeadLinkTest.php

@@ -463,6 +463,15 @@ class Zend_View_Helper_HeadLinkTest extends PHPUnit_Framework_TestCase
 
 
         $this->assertEquals($expected, $test);
         $this->assertEquals($expected, $test);
     }
     }
+
+    /**
+     * @issue ZF-10345
+     */
+    public function testIdAttributeIsSupported()
+    {
+        $this->helper->appendStylesheet(array('href' => '/bar/baz', 'id' => 'foo'));
+        $this->assertContains('id="foo"', $this->helper->toString());
+    }
 }
 }
 
 
 // Call Zend_View_Helper_HeadLinkTest::main() if this source file is executed directly.
 // Call Zend_View_Helper_HeadLinkTest::main() if this source file is executed directly.