Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

[ZF-11835] Add conditional comments functionality to Zend_View_Helper_HeadMeta #624

Merged
merged 1 commit into from

2 participants

Adam Lundrigan Rob Allen
Adam Lundrigan

SVN sync r24561 / r24562

Rob Allen akrabat merged commit c8bde6a into from
Rob Allen
Collaborator

Thanks Adam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 21, 2011
  1. Adam Lundrigan
This page is out of date. Refresh to see the latest.
8 library/Zend/View/Helper/HeadMeta.php
View
@@ -371,6 +371,14 @@ public function itemToString(\stdClass $item)
$this->_escape($item->content),
$modifiersString
);
+
+ if (isset($item->modifiers['conditional'])
+ && !empty($item->modifiers['conditional'])
+ && is_string($item->modifiers['conditional']))
+ {
+ $meta = '<!--[if ' . $this->_escape($item->modifiers['conditional']) . ']>' . $meta . '<![endif]-->';
+ }
+
return $meta;
}
11 tests/Zend/View/Helper/HeadMetaTest.php
View
@@ -441,5 +441,16 @@ public function testCharset()
$view->plugin('headMeta')->toString());
}
+ /**
+ * @group ZF-11835
+ */
+ public function testConditional()
+ {
+ $html = $this->helper->appendHttpEquiv('foo', 'bar', array('conditional' => 'lt IE 7'))->toString();
+
+ $this->assertRegExp("|^<!--\[if lt IE 7\]>|", $html);
+ $this->assertRegExp("|<!\[endif\]-->$|", $html);
+ }
+
}
Something went wrong with that request. Please try again.