<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Menu highlighting with CakePHP 1.2</title>
	<atom:link href="http://www.solitechgmbh.com/2008/06/06/menu-highlighting-with-cakephp-12/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.solitechgmbh.com/2008/06/06/menu-highlighting-with-cakephp-12/</link>
	<description>Connecting businesses to people through effective online marketing strategy</description>
	<lastBuildDate>Wed, 12 May 2010 13:25:08 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Asama</title>
		<link>http://www.solitechgmbh.com/2008/06/06/menu-highlighting-with-cakephp-12/comment-page-1/#comment-3737</link>
		<dc:creator>Asama</dc:creator>
		<pubDate>Fri, 12 Mar 2010 04:45:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.gyuropia.com/?p=41#comment-3737</guid>
		<description>It is very good. I can use. ^_^

At app_controller.php use

 var $helpers = array(‘Html’, ‘Menu’);

Then change code

echo link(&#039;Home&#039;,&#039;/&#039;, array(&#039;title&#039; =&gt; &#039;Home&#039;, &#039;class&#039; =&gt; $menu-&gt;highlight(&quot;/$&quot;))) 


To

echo $html-&gt;link(‘Home’,&#039;/’, array(‘title’ =&gt; ‘Home’, ‘class’ =&gt; $menu-&gt;highlight(“/$”))) 

Just as this can work.</description>
		<content:encoded><![CDATA[<p>It is very good. I can use. ^_^</p>
<p>At app_controller.php use</p>
<p> var $helpers = array(‘Html’, ‘Menu’);</p>
<p>Then change code</p>
<p>echo link(&#8216;Home&#8217;,'/&#8217;, array(&#8216;title&#8217; =&gt; &#8216;Home&#8217;, &#8216;class&#8217; =&gt; $menu-&gt;highlight(&#8220;/$&#8221;))) </p>
<p>To</p>
<p>echo $html-&gt;link(‘Home’,&#8217;/’, array(‘title’ =&gt; ‘Home’, ‘class’ =&gt; $menu-&gt;highlight(“/$”))) </p>
<p>Just as this can work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: William</title>
		<link>http://www.solitechgmbh.com/2008/06/06/menu-highlighting-with-cakephp-12/comment-page-1/#comment-3734</link>
		<dc:creator>William</dc:creator>
		<pubDate>Sat, 06 Feb 2010 11:05:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.gyuropia.com/?p=41#comment-3734</guid>
		<description>sorry I forgot the &#039;$&#039; after the &#039;/&#039;.
But it does not work for the pages controller.</description>
		<content:encoded><![CDATA[<p>sorry I forgot the &#8216;$&#8217; after the &#8216;/&#8217;.<br />
But it does not work for the pages controller.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: William</title>
		<link>http://www.solitechgmbh.com/2008/06/06/menu-highlighting-with-cakephp-12/comment-page-1/#comment-3732</link>
		<dc:creator>William</dc:creator>
		<pubDate>Sat, 06 Feb 2010 09:57:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.gyuropia.com/?p=41#comment-3732</guid>
		<description>home link &#039;/&#039; is always highlighted. Is there a way to solve this problem ?</description>
		<content:encoded><![CDATA[<p>home link &#8216;/&#8217; is always highlighted. Is there a way to solve this problem ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paolo</title>
		<link>http://www.solitechgmbh.com/2008/06/06/menu-highlighting-with-cakephp-12/comment-page-1/#comment-3725</link>
		<dc:creator>Paolo</dc:creator>
		<pubDate>Tue, 21 Jul 2009 14:23:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.gyuropia.com/?p=41#comment-3725</guid>
		<description>hi,

I modify the function to accept an array as $path. The result:

	function highlight($path, $normal = &#039;navLink&#039;, $selected = &#039;navLinkSelected&#039;) {
		$class = &#039; &#039;.$normal;
		$currentPath = substr($this-&gt;Html-&gt;here, strlen($this-&gt;Html-&gt;base));
		// if there is a star in the path we need to do different checking
		$regs = array();		
		if (!is_array($path) &amp;&amp; ereg($path,$currentPath,$regs)){
			$class .= &#039; &#039;.$selected;
		}else if (is_array($path)){
		  foreach($path as $value){
        if (ereg($value,$currentPath,$regs)){
          $class .= &#039; &#039;.$selected;
          break;
        }
      }
		}
		return $class;
    }</description>
		<content:encoded><![CDATA[<p>hi,</p>
<p>I modify the function to accept an array as $path. The result:</p>
<p>	function highlight($path, $normal = &#8216;navLink&#8217;, $selected = &#8216;navLinkSelected&#8217;) {<br />
		$class = &#8216; &#8216;.$normal;<br />
		$currentPath = substr($this-&gt;Html-&gt;here, strlen($this-&gt;Html-&gt;base));<br />
		// if there is a star in the path we need to do different checking<br />
		$regs = array();<br />
		if (!is_array($path) &amp;&amp; ereg($path,$currentPath,$regs)){<br />
			$class .= &#8216; &#8216;.$selected;<br />
		}else if (is_array($path)){<br />
		  foreach($path as $value){<br />
        if (ereg($value,$currentPath,$regs)){<br />
          $class .= &#8216; &#8216;.$selected;<br />
          break;<br />
        }<br />
      }<br />
		}<br />
		return $class;<br />
    }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard@Home</title>
		<link>http://www.solitechgmbh.com/2008/06/06/menu-highlighting-with-cakephp-12/comment-page-1/#comment-3722</link>
		<dc:creator>Richard@Home</dc:creator>
		<pubDate>Fri, 19 Jun 2009 12:53:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.gyuropia.com/?p=41#comment-3722</guid>
		<description>My Link Helper does a similar job:

http://richardathome.com/blog/cakephp-smarter-links</description>
		<content:encoded><![CDATA[<p>My Link Helper does a similar job:</p>
<p><a href="http://richardathome.com/blog/cakephp-smarter-links" rel="nofollow">http://richardathome.com/blog/cakephp-smarter-links</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Olu</title>
		<link>http://www.solitechgmbh.com/2008/06/06/menu-highlighting-with-cakephp-12/comment-page-1/#comment-3720</link>
		<dc:creator>Olu</dc:creator>
		<pubDate>Wed, 10 Jun 2009 17:27:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.gyuropia.com/?p=41#comment-3720</guid>
		<description>Where do you save this file, app/views/helpers or app/helpers?</description>
		<content:encoded><![CDATA[<p>Where do you save this file, app/views/helpers or app/helpers?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dom</title>
		<link>http://www.solitechgmbh.com/2008/06/06/menu-highlighting-with-cakephp-12/comment-page-1/#comment-221</link>
		<dc:creator>Dom</dc:creator>
		<pubDate>Mon, 01 Dec 2008 20:42:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.gyuropia.com/?p=41#comment-221</guid>
		<description>Hey, this works like a charm. Many thanks! :)</description>
		<content:encoded><![CDATA[<p>Hey, this works like a charm. Many thanks! <img src='http://www.solitechgmbh.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: depi</title>
		<link>http://www.solitechgmbh.com/2008/06/06/menu-highlighting-with-cakephp-12/comment-page-1/#comment-219</link>
		<dc:creator>depi</dc:creator>
		<pubDate>Mon, 04 Aug 2008 18:53:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.gyuropia.com/?p=41#comment-219</guid>
		<description>Hello Gyuri (BTW your are Hungarian? :))

I found it out myself, but I had problems highlighting the home page when it was accesses id by &quot;/&quot;, but as I got back here I find the updated version which is great!
So basically the $path in the function is a regular expression, right?
Shouldn&#039;t this $menu-&gt;highlight(&quot;/$&quot;) be $menu-&gt;highlight(&quot;^/$&quot;) ? Or it doesn&#039;t matter? I&#039;m just curious (I&#039;m not so good in regexp)

Still thanks for your helper, I really like it.</description>
		<content:encoded><![CDATA[<p>Hello Gyuri (BTW your are Hungarian? <img src='http://www.solitechgmbh.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )</p>
<p>I found it out myself, but I had problems highlighting the home page when it was accesses id by &#8220;/&#8221;, but as I got back here I find the updated version which is great!<br />
So basically the $path in the function is a regular expression, right?<br />
Shouldn&#8217;t this $menu-&gt;highlight(&#8220;/$&#8221;) be $menu-&gt;highlight(&#8220;^/$&#8221;) ? Or it doesn&#8217;t matter? I&#8217;m just curious (I&#8217;m not so good in regexp)</p>
<p>Still thanks for your helper, I really like it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gyuri</title>
		<link>http://www.solitechgmbh.com/2008/06/06/menu-highlighting-with-cakephp-12/comment-page-1/#comment-220</link>
		<dc:creator>Gyuri</dc:creator>
		<pubDate>Mon, 04 Aug 2008 13:49:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.gyuropia.com/?p=41#comment-220</guid>
		<description>depi: I updated the post and added some examples. I hope this helps. Also, any suggestions for improvements are welcome.</description>
		<content:encoded><![CDATA[<p>depi: I updated the post and added some examples. I hope this helps. Also, any suggestions for improvements are welcome.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: depi</title>
		<link>http://www.solitechgmbh.com/2008/06/06/menu-highlighting-with-cakephp-12/comment-page-1/#comment-218</link>
		<dc:creator>depi</dc:creator>
		<pubDate>Mon, 04 Aug 2008 12:04:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.gyuropia.com/?p=41#comment-218</guid>
		<description>Could you please include also an example how to use that helper? It should be included in the HTML helper link method call?</description>
		<content:encoded><![CDATA[<p>Could you please include also an example how to use that helper? It should be included in the HTML helper link method call?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
