function _initPlaceHolders(&$options) { if (!empty($options['docType'])) { $helper = new Zend_View_Helper_Doctype(); $helper->doctype($options['docType']); } if (!empty($options['css'])) { $helper = new Zend_View_Helper_HeadLink(); if (is_array($options['css'])) { foreach ($options['css'] as $css) { $helper->appendStylesheet($css); } } else { $helper->appendStylesheet($options['css']); } } if (!empty($options['headMeta'])) { $meta = $options['headMeta']; $helper = new Zend_View_Helper_HeadMeta(); if (!empty($meta['http-equiv'])) { $equiv = $meta['http-equiv']; foreach ($equiv as $key => $value) { $helper->appendHttpEquiv($key, $value); } } } }
public function appendStylesheet($item) { if (!preg_match('/^http/i', $item)) { $item .= '?v=' . $this->_appversion; } parent::appendStylesheet($item); }
public function testIndentationIsHonored() { $this->helper->setIndent(4); $this->helper->appendStylesheet('/css/screen.css'); $this->helper->appendStylesheet('/css/rules.css'); $string = $this->helper->toString(); $scripts = substr_count($string, ' <link '); $this->assertEquals(2, $scripts); }
public function testSetStylesheetWithMediaAsArray() { $this->helper->appendStylesheet('/bar/baz', array('screen', 'print')); $test = $this->helper->toString(); $this->assertContains(' media="screen,print"', $test); }
/** * @group ZF-11811 */ public function testHeadLinkAllowsOverrideOfRelAttribute() { $this->helper->appendStylesheet('/css/auth.less', 'all', null, array('rel' => 'stylesheet/less')); $this->assertEquals(1, substr_count($this->helper->toString(), "rel=\"")); $this->assertContains('rel="stylesheet/less"', $this->helper->toString()); }
/** * @issue ZF-10345 */ public function testIdAttributeIsSupported() { $this->helper->appendStylesheet(array('href' => '/bar/baz', 'id' => 'foo')); $this->assertContains('id="foo"', $this->helper->toString()); }
public function testDoesNotAllowDuplicateStylesheets() { $this->helper->appendStylesheet('foo'); $this->helper->appendStylesheet('foo'); $this->assertEquals(1, count($this->helper), var_export($this->helper->getContainer()->getArrayCopy(), 1)); }
/** * test for ZF-2889 */ public function testBooleanStylesheet() { $this->helper->appendStylesheet(array('href' => '/bar/baz', 'conditionalStylesheet' => false)); $test = $this->helper->toString(); $this->assertNotContains('[if false]', $test); }