<?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: CakePHP and Layout &#8211; secret of data passing through</title>
	<atom:link href="http://nik.chankov.net/2007/10/10/cakephp-and-layout-secret-of-data-passing-through/feed/" rel="self" type="application/rss+xml" />
	<link>http://nik.chankov.net/2007/10/10/cakephp-and-layout-secret-of-data-passing-through/</link>
	<description>Technical weblog for articles and titorials related to web development.</description>
	<lastBuildDate>Fri, 12 Mar 2010 13:43:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: abhishek</title>
		<link>http://nik.chankov.net/2007/10/10/cakephp-and-layout-secret-of-data-passing-through/comment-page-1/#comment-3789</link>
		<dc:creator>abhishek</dc:creator>
		<pubDate>Thu, 26 Nov 2009 08:43:15 +0000</pubDate>
		<guid isPermaLink="false">http://nik.chankov.net/2007/10/10/cakephp-and-layout-secret-of-data-passing-through/#comment-3789</guid>
		<description>Hey this is good article one this missing was names for each files and their location on top of each code will eliminate all confusions</description>
		<content:encoded><![CDATA[<p>Hey this is good article one this missing was names for each files and their location on top of each code will eliminate all confusions</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: How to deal with Layouts in CakePHP &#124; Vietnam Online Marketing Addict &#124; Nganhtuan.com</title>
		<link>http://nik.chankov.net/2007/10/10/cakephp-and-layout-secret-of-data-passing-through/comment-page-1/#comment-1540</link>
		<dc:creator>How to deal with Layouts in CakePHP &#124; Vietnam Online Marketing Addict &#124; Nganhtuan.com</dc:creator>
		<pubDate>Mon, 21 Sep 2009 14:24:29 +0000</pubDate>
		<guid isPermaLink="false">http://nik.chankov.net/2007/10/10/cakephp-and-layout-secret-of-data-passing-through/#comment-1540</guid>
		<description>[...] Secret of data passing through in cakephp layout  You can leave a comment, or trackback from your own site. RSS 2.0 [...]</description>
		<content:encoded><![CDATA[<p>[...] Secret of data passing through in cakephp layout  You can leave a comment, or trackback from your own site. RSS 2.0 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: render_da_pain</title>
		<link>http://nik.chankov.net/2007/10/10/cakephp-and-layout-secret-of-data-passing-through/comment-page-1/#comment-1458</link>
		<dc:creator>render_da_pain</dc:creator>
		<pubDate>Sat, 19 Sep 2009 12:06:17 +0000</pubDate>
		<guid isPermaLink="false">http://nik.chankov.net/2007/10/10/cakephp-and-layout-secret-of-data-passing-through/#comment-1458</guid>
		<description>I think using components with requestAction() is much more better :D
true MVC style FTW :D</description>
		<content:encoded><![CDATA[<p>I think using components with requestAction() is much more better <img src='http://nik.chankov.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
true MVC style FTW <img src='http://nik.chankov.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gurel</title>
		<link>http://nik.chankov.net/2007/10/10/cakephp-and-layout-secret-of-data-passing-through/comment-page-1/#comment-759</link>
		<dc:creator>gurel</dc:creator>
		<pubDate>Thu, 21 May 2009 09:20:07 +0000</pubDate>
		<guid isPermaLink="false">http://nik.chankov.net/2007/10/10/cakephp-and-layout-secret-of-data-passing-through/#comment-759</guid>
		<description>had problems uploading png&#039;s too. you can edit line 302 from: 
imagepng($newImage, $dstimg, $quality);
to:
imagepng($newImage, $dstimg, 9);</description>
		<content:encoded><![CDATA[<p>had problems uploading png&#8217;s too. you can edit line 302 from:<br />
imagepng($newImage, $dstimg, $quality);<br />
to:<br />
imagepng($newImage, $dstimg, 9);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Widgets et contenu modulaire avec CakePHP - Pierre MARTIN</title>
		<link>http://nik.chankov.net/2007/10/10/cakephp-and-layout-secret-of-data-passing-through/comment-page-1/#comment-676</link>
		<dc:creator>Widgets et contenu modulaire avec CakePHP - Pierre MARTIN</dc:creator>
		<pubDate>Sun, 01 Mar 2009 09:15:42 +0000</pubDate>
		<guid isPermaLink="false">http://nik.chankov.net/2007/10/10/cakephp-and-layout-secret-of-data-passing-through/#comment-676</guid>
		<description>[...] par manque de temps principalement, j&#8217;ai effectué quelques recherches et ai trouvé (entre autres) un article d&#8217;Andy Dawson (AD7six) présentant ces &#8220;Mini Controllers&#8221;. Cette [...]</description>
		<content:encoded><![CDATA[<p>[...] par manque de temps principalement, j&#8217;ai effectué quelques recherches et ai trouvé (entre autres) un article d&#8217;Andy Dawson (AD7six) présentant ces &#8220;Mini Controllers&#8221;. Cette [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter James</title>
		<link>http://nik.chankov.net/2007/10/10/cakephp-and-layout-secret-of-data-passing-through/comment-page-1/#comment-662</link>
		<dc:creator>Peter James</dc:creator>
		<pubDate>Wed, 25 Feb 2009 15:02:33 +0000</pubDate>
		<guid isPermaLink="false">http://nik.chankov.net/2007/10/10/cakephp-and-layout-secret-of-data-passing-through/#comment-662</guid>
		<description>ok cool - how do you post code on your blog? that looks rubbish above lol

just noticed the date on this blog entry! good work :)</description>
		<content:encoded><![CDATA[<p>ok cool &#8211; how do you post code on your blog? that looks rubbish above lol</p>
<p>just noticed the date on this blog entry! good work <img src='http://nik.chankov.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nik Chankov</title>
		<link>http://nik.chankov.net/2007/10/10/cakephp-and-layout-secret-of-data-passing-through/comment-page-1/#comment-661</link>
		<dc:creator>Nik Chankov</dc:creator>
		<pubDate>Wed, 25 Feb 2009 14:58:57 +0000</pubDate>
		<guid isPermaLink="false">http://nik.chankov.net/2007/10/10/cakephp-and-layout-secret-of-data-passing-through/#comment-661</guid>
		<description>Yoy are right, now extract has different syntax. I will change it in order to fit with the new one. Thanks</description>
		<content:encoded><![CDATA[<p>Yoy are right, now extract has different syntax. I will change it in order to fit with the new one. Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter James</title>
		<link>http://nik.chankov.net/2007/10/10/cakephp-and-layout-secret-of-data-passing-through/comment-page-1/#comment-660</link>
		<dc:creator>Peter James</dc:creator>
		<pubDate>Wed, 25 Feb 2009 14:56:01 +0000</pubDate>
		<guid isPermaLink="false">http://nik.chankov.net/2007/10/10/cakephp-and-layout-secret-of-data-passing-through/#comment-660</guid>
		<description>Right - I get you :)

With regards to my previous comment I worked it out - it was the old notation that threw me somewhat as I am used to XPath.

&lt;code lang=&quot;php&quot;&gt;
function display(&amp;$layoutData) {
	      //This extracting only the name of the menu from the multidimentional array.
	      //$contents = Set::extract(&#039;/User/username&#039;, $data[&#039;User&#039;]);
	      $avatars = Set::extract(&#039;/UserProfile/avatar&#039;, $layoutData[&#039;UserProfile&#039;]);
	      $usernames = Set::extract(&#039;/User/username&#039;, $layoutData[&#039;UserProfile&#039;]);
	      
	      $ret = &quot;&quot;;
	      
	      for($i; $i&lt;=count($usernames); $i++) {
	      	
	      		$ret.=&quot;&quot;.$usernames[$i].&quot;&quot;;
	      }
	      $ret .= &quot;&quot;;
	      return $ret;
	     
	   }&lt;/code&gt;

</description>
		<content:encoded><![CDATA[<p>Right &#8211; I get you <img src='http://nik.chankov.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>With regards to my previous comment I worked it out &#8211; it was the old notation that threw me somewhat as I am used to XPath.</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">function</span> display<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;</span><span style="color: #000088;">$layoutData</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//This extracting only the name of the menu from the multidimentional array.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//$contents = Set::extract('/User/username', $data['User']);</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$avatars</span> <span style="color: #339933;">=</span> Set<span style="color: #339933;">::</span><a href="http://www.php.net/extract"><span style="color: #990000;">extract</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/UserProfile/avatar'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$layoutData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'UserProfile'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$usernames</span> <span style="color: #339933;">=</span> Set<span style="color: #339933;">::</span><a href="http://www.php.net/extract"><span style="color: #990000;">extract</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/User/username'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$layoutData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'UserProfile'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$ret</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;=</span><a href="http://www.php.net/count"><span style="color: #990000;">count</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$usernames</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$ret</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$usernames</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$ret</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$ret</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&#125;</span></div></div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nik Chankov</title>
		<link>http://nik.chankov.net/2007/10/10/cakephp-and-layout-secret-of-data-passing-through/comment-page-1/#comment-659</link>
		<dc:creator>Nik Chankov</dc:creator>
		<pubDate>Wed, 25 Feb 2009 14:50:36 +0000</pubDate>
		<guid isPermaLink="false">http://nik.chankov.net/2007/10/10/cakephp-and-layout-secret-of-data-passing-through/#comment-659</guid>
		<description>Peter, it should not if you using $this-&gt;data[&#039;show_menu&#039;] or some unique string which doesn&#039;t match Menu controller. 

In fact if you have Menu form and you are using my method - yes it will be a problem. But my example is proov of concept. I would use PublicMenu and AdminMenu as $this-&gt;data nodes instead of Menu only.</description>
		<content:encoded><![CDATA[<p>Peter, it should not if you using $this->data['show_menu'] or some unique string which doesn&#8217;t match Menu controller. </p>
<p>In fact if you have Menu form and you are using my method &#8211; yes it will be a problem. But my example is proov of concept. I would use PublicMenu and AdminMenu as $this->data nodes instead of Menu only.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter James</title>
		<link>http://nik.chankov.net/2007/10/10/cakephp-and-layout-secret-of-data-passing-through/comment-page-1/#comment-658</link>
		<dc:creator>Peter James</dc:creator>
		<pubDate>Wed, 25 Feb 2009 14:42:10 +0000</pubDate>
		<guid isPermaLink="false">http://nik.chankov.net/2007/10/10/cakephp-and-layout-secret-of-data-passing-through/#comment-658</guid>
		<description>&lt;a href=&quot;#comment-623&quot; rel=&quot;nofollow&quot;&gt;@Nik Chankov&lt;/a&gt; 
Nik,

This causes problems on mysetup when passing data to and from edit methods of controllers, e.g. if you were editing a menu using your example above this data will be overwritten when passed through to the edit method?</description>
		<content:encoded><![CDATA[<p><a href="#comment-623" rel="nofollow">@Nik Chankov</a><br />
Nik,</p>
<p>This causes problems on mysetup when passing data to and from edit methods of controllers, e.g. if you were editing a menu using your example above this data will be overwritten when passed through to the edit method?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
