<?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>Derilicious&#187; Posts tagged with HtmlHelper &#8211; Page  &#8211; Derilicious</title> <atom:link href="http://derickng.com/posts/tag/htmlhelper/feed" rel="self" type="application/rss+xml" /><link>http://derickng.com</link> <description>A blog on web development technicalities by Derick Ng</description> <lastBuildDate>Sun, 20 Dec 2009 12:18:03 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>CakePHP&#8217;s HtmlHelper::link() Escaping of Attribute Values Gotcha</title><link>http://derickng.com/posts/80-cakephps-htmlhelperlink-escaping-of-attribute-values-gotcha</link> <comments>http://derickng.com/posts/80-cakephps-htmlhelperlink-escaping-of-attribute-values-gotcha#comments</comments> <pubDate>Wed, 15 Apr 2009 09:18:29 +0000</pubDate> <dc:creator>Derick Ng</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[CakePHP]]></category> <category><![CDATA[HtmlHelper]]></category><guid
isPermaLink="false">http://derickng.com/?p=80</guid> <description><![CDATA[Just updated pHing Classifieds to CakePHP 1.2.2.8120 and that breaks some JavaScript codes for deleting of messages.  Turns out the escape attribute is now passed on to Helper::parseAttributes() so if you have an image link like me, you will have to remember to manually escape the attribute values.&#60;?= $appHtml-&#62;link(
$appHtml-&#62;image(&#039;icons/bin.png&#039;),
[...]]]></description> <content:encoded><![CDATA[<p>Just updated <a
title="pHing Classifieds" href="http://phing.com">pHing Classifieds</a> to <a
href="http://bakery.cakephp.org/articles/view/release-1-2-2-8120">CakePHP 1.2.2.8120</a> and that breaks some JavaScript codes for deleting of messages.  Turns out the escape attribute is now passed on to Helper::parseAttributes() so if you have an image link like me, you will have to remember to manually escape the attribute values.</p><pre class="brush: php">
&lt;?= $appHtml-&gt;link(
   $appHtml-&gt;image(&#039;icons/bin.png&#039;),
   &#039;#&#039;,
   array(
      &#039;escape&#039; =&gt; false,
      &#039;onclick&#039; =&gt; h(&#039;if (confirm(&quot;True?&quot;)) alert (&quot;Yes&quot;); return false;&#039;)
   )
) ?&gt;
</pre><p>Not a big issue and it probably seem more consistent that the escape option is applied to both the link title and the HTML attributes. See ticket <a
href="https://trac.cakephp.org/ticket/6071">#6071</a> for why it was changed and <a
href="https://trac.cakephp.org/changeset/8053/branches/1.2.x.x/cake/libs/view/helpers/html.php">what was changed</a>.</p> ]]></content:encoded> <wfw:commentRss>http://derickng.com/posts/80-cakephps-htmlhelperlink-escaping-of-attribute-values-gotcha/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (user agent is rejected)
Database Caching 6/13 queries in 0.003 seconds using disk

Served from: derickng.com @ 2010-08-01 04:27:02 -->