<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Zend Framework Blog &#187; IE conditional comments in Zend Framework</title>
	<atom:link href="http://blog.richardknop.com/tag/ie-conditional-comments-in-zend-framework/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.richardknop.com</link>
	<description>Zend Framework, PHP, Django, Python, SQL, MySQL, PostgreSQL, Oracle, PL/SQL, data model patterns, OOP, design patterns, JavaScript, jQuery, HTML, XHTML, CSS, XML, web services &#38; APIs, Security, E-commerce and much more</description>
	<lastBuildDate>Sat, 04 Feb 2012 19:47:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Zend Framework IE conditional stylesheets and scripts</title>
		<link>http://blog.richardknop.com/2010/03/zend-framework-ie-conditional-stylesheets-and-scripts/</link>
		<comments>http://blog.richardknop.com/2010/03/zend-framework-ie-conditional-stylesheets-and-scripts/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 21:27:17 +0000</pubDate>
		<dc:creator>Richard Knop</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web design]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[IE conditional comments in Zend Framework]]></category>
		<category><![CDATA[Zend view helpers]]></category>

		<guid isPermaLink="false">http://blog.richardknop.com/?p=559</guid>
		<description><![CDATA[You can append a conditional stylesheet in a controller action like this: $this-&#62;view-&#62;headLink&#40;&#41;-&#62;appendStylesheet&#40;&#39;/path/to/some/styles.css&#39;, &#39;screen&#39;, &#39;IE 8&#39;&#41;; Which would produce this markup: &#60;!--[if IE 8]&#62; &#60;link href="/path/to/some/styles.css" media="screen" rel="stylesheet" type="text/css" /&#62;&#60;![endif]--&#62; Adding a conditional JavaScript file is similar: $this-&#62;view-&#62;headScript&#40;&#41;-&#62;appendFile&#40;&#39;/path/to/some/script.js&#39;, &#39;text/javascript&#39;, array&#40;&#39;conditional&#39; =&#62; &#39;IE&#39;&#41;&#41;; And that would produce markup like this: &#60;!--[if IE]&#62; &#60;script type="text/javascript" src="/path/to/some/script.js"&#62;&#60;/script&#62;&#60;![endif]--&#62; It [...]]]></description>
			<content:encoded><![CDATA[<p>You can append a conditional stylesheet in a controller action like this:</p>
<div class="geshi no php">
<ol>
<li class="li1">
<div class="de1"><span class="re1">$this</span><span class="sy0">-&gt;</span><span class="me1">view</span><span class="sy0">-&gt;</span><span class="me1">headLink</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">-&gt;</span><span class="me1">appendStylesheet</span><span class="br0">&#40;</span><span class="st0">&#39;/path/to/some/styles.css&#39;</span><span class="sy0">,</span> <span class="st0">&#39;screen&#39;</span><span class="sy0">,</span> <span class="st0">&#39;IE 8&#39;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
</ol>
</div>
<p>Which would produce this markup:</p>
<pre>&lt;!--[if IE 8]&gt; &lt;link href="/path/to/some/styles.css" media="screen" rel="stylesheet" type="text/css" /&gt;&lt;![endif]--&gt;</pre>
<p>Adding a conditional JavaScript file is similar:</p>
<div class="geshi no php">
<ol>
<li class="li1">
<div class="de1"><span class="re1">$this</span><span class="sy0">-&gt;</span><span class="me1">view</span><span class="sy0">-&gt;</span><span class="me1">headScript</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">-&gt;</span><span class="me1">appendFile</span><span class="br0">&#40;</span><span class="st0">&#39;/path/to/some/script.js&#39;</span><span class="sy0">,</span> <span class="st0">&#39;text/javascript&#39;</span><span class="sy0">,</span> <span class="kw3">array</span><span class="br0">&#40;</span><span class="st0">&#39;conditional&#39;</span> <span class="sy0">=&gt;</span> <span class="st0">&#39;IE&#39;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
</ol>
</div>
<p>And that would produce markup like this:</p>
<pre>&lt;!--[if IE]&gt; &lt;script type="text/javascript" src="/path/to/some/script.js"&gt;&lt;/script&gt;&lt;![endif]--&gt;</pre>
<p>It can pretty useful when you need to use IE conditional comments just for a single controller action. Otherwise, if it applies site-wide, it&#8217;s better to just put conditional stylesheets and/or scripts in a layout file.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.richardknop.com/2010/03/zend-framework-ie-conditional-stylesheets-and-scripts/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

