<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Beware of the underscore</title>
	<link>http://myeasyscripts.com/loudbaking/beware-of-the-underscore/</link>
	<description>Specialty cuisines: app development, internet marketing and entrepreneurship</description>
	<pubDate>Thu, 04 Dec 2008 23:25:23 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2</generator>

	<item>
		<title>By: Nik Chankov</title>
		<link>http://myeasyscripts.com/loudbaking/beware-of-the-underscore/#comment-2826</link>
		<author>Nik Chankov</author>
		<pubDate>Mon, 06 Oct 2008 13:20:53 +0000</pubDate>
		<guid>http://myeasyscripts.com/loudbaking/beware-of-the-underscore/#comment-2826</guid>
		<description>&lt;p&gt;I also noticed this "bug" and I know that I should not use compact with underscored vars.&lt;/p&gt;

&lt;p&gt;Although it's more convenient, I've always used $this-&#62;set('var&lt;em&gt;name'=&#62;'var&lt;/em&gt;value');
For me it's more clear.&lt;/p&gt;

&lt;p&gt;the approach proposed from taylor luk - ya, it could do the job, but it is so complicated :)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I also noticed this &#8220;bug&#8221; and I know that I should not use compact with underscored vars.</p>

<p>Although it&#8217;s more convenient, I&#8217;ve always used $this-&gt;set(&#8217;var<em>name&#8217;=&gt;&#8217;var</em>value&#8217;);
For me it&#8217;s more clear.</p>

<p>the approach proposed from taylor luk - ya, it could do the job, but it is so complicated <img src='http://myeasyscripts.com/loudbaking/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>]]></content:encoded>
	</item>
	<item>
		<title>By: Jad</title>
		<link>http://myeasyscripts.com/loudbaking/beware-of-the-underscore/#comment-2739</link>
		<author>Jad</author>
		<pubDate>Fri, 26 Sep 2008 01:10:04 +0000</pubDate>
		<guid>http://myeasyscripts.com/loudbaking/beware-of-the-underscore/#comment-2739</guid>
		<description>&lt;p&gt;@taylor: nice!! haven't checked the code but that definitely fixes it.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@taylor: nice!! haven&#8217;t checked the code but that definitely fixes it.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: taylor luk</title>
		<link>http://myeasyscripts.com/loudbaking/beware-of-the-underscore/#comment-2738</link>
		<author>taylor luk</author>
		<pubDate>Fri, 26 Sep 2008 01:03:27 +0000</pubDate>
		<guid>http://myeasyscripts.com/loudbaking/beware-of-the-underscore/#comment-2738</guid>
		<description>&lt;p&gt;Here is the work around.. 
Either set one variable at the time or when doing pass set pass false as second variable. &lt;/p&gt;

&lt;p&gt;$this-&#62;set('under&lt;em&gt;scored&lt;/em&gt;words', 'ok');&lt;/p&gt;

&lt;p&gt;$this-&#62;set(array(
    'under&lt;em&gt;scored&lt;/em&gt;words' =&#62; 'ok',
    'cake&lt;em&gt;stop&lt;/em&gt;rewrite&lt;em&gt;my&lt;/em&gt;vars' =&#62; 'true
), false)&lt;/p&gt;

&lt;p&gt;$this-&#62;set(compact('under&lt;em&gt;scored&lt;/em&gt;words'), false);&lt;/p&gt;

&lt;p&gt;hope this help&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Here is the work around.. 
Either set one variable at the time or when doing pass set pass false as second variable. </p>

<p>$this-&gt;set(&#8217;under<em>scored</em>words&#8217;, &#8216;ok&#8217;);</p>

<p>$this-&gt;set(array(
    &#8216;under<em>scored</em>words&#8217; =&gt; &#8216;ok&#8217;,
    &#8216;cake<em>stop</em>rewrite<em>my</em>vars&#8217; =&gt; &#8216;true
), false)</p>

<p>$this-&gt;set(compact(&#8217;under<em>scored</em>words&#8217;), false);</p>

<p>hope this help</p>]]></content:encoded>
	</item>
	<item>
		<title>By: rafaelbandeira3</title>
		<link>http://myeasyscripts.com/loudbaking/beware-of-the-underscore/#comment-2736</link>
		<author>rafaelbandeira3</author>
		<pubDate>Thu, 25 Sep 2008 21:23:38 +0000</pubDate>
		<guid>http://myeasyscripts.com/loudbaking/beware-of-the-underscore/#comment-2736</guid>
		<description>&lt;p&gt;@klevo: actually CamelCase and camelBack, Inflector::variable() transform your underscored_string in a camelBackedString.&lt;/p&gt;

&lt;p&gt;@Jad: I think it would make more sense to make all vars have their names pimped by Inflector::variable();&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@klevo: actually CamelCase and camelBack, Inflector::variable() transform your underscored_string in a camelBackedString.</p>

<p>@Jad: I think it would make more sense to make all vars have their names pimped by Inflector::variable();</p>]]></content:encoded>
	</item>
	<item>
		<title>By: hydra12</title>
		<link>http://myeasyscripts.com/loudbaking/beware-of-the-underscore/#comment-2735</link>
		<author>hydra12</author>
		<pubDate>Thu, 25 Sep 2008 21:19:22 +0000</pubDate>
		<guid>http://myeasyscripts.com/loudbaking/beware-of-the-underscore/#comment-2735</guid>
		<description>&lt;p&gt;I think they intend for things to work that way (I'm not sure why).  For instance, if you create a controller called myController, and name your view myController.ctp, you'll get a file not found error.  You have to name the view my_controller.ctp.  It seems to be a convention in cake.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I think they intend for things to work that way (I&#8217;m not sure why).  For instance, if you create a controller called myController, and name your view myController.ctp, you&#8217;ll get a file not found error.  You have to name the view my_controller.ctp.  It seems to be a convention in cake.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Jad</title>
		<link>http://myeasyscripts.com/loudbaking/beware-of-the-underscore/#comment-2734</link>
		<author>Jad</author>
		<pubDate>Thu, 25 Sep 2008 20:22:42 +0000</pubDate>
		<guid>http://myeasyscripts.com/loudbaking/beware-of-the-underscore/#comment-2734</guid>
		<description>&lt;p&gt;@all: thanks for dropping by&lt;/p&gt;

&lt;p&gt;@klevo: if that's the case, then it should check if a model with that name exists first, no? would make more sense if you ask me.&lt;/p&gt;

&lt;p&gt;@dave: i have a hard time changing my coding conventions to work around something that is not functioning correctly ;)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@all: thanks for dropping by</p>

<p>@klevo: if that&#8217;s the case, then it should check if a model with that name exists first, no? would make more sense if you ask me.</p>

<p>@dave: i have a hard time changing my coding conventions to work around something that is not functioning correctly <img src='http://myeasyscripts.com/loudbaking/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>]]></content:encoded>
	</item>
	<item>
		<title>By: dave</title>
		<link>http://myeasyscripts.com/loudbaking/beware-of-the-underscore/#comment-2732</link>
		<author>dave</author>
		<pubDate>Thu, 25 Sep 2008 20:10:30 +0000</pubDate>
		<guid>http://myeasyscripts.com/loudbaking/beware-of-the-underscore/#comment-2732</guid>
		<description>&lt;p&gt;i encountered this problem at one time. i think i remember that the variables get sent to the view as fooBar. i just make a point of not using an underscore anymore.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>i encountered this problem at one time. i think i remember that the variables get sent to the view as fooBar. i just make a point of not using an underscore anymore.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: klevo</title>
		<link>http://myeasyscripts.com/loudbaking/beware-of-the-underscore/#comment-2731</link>
		<author>klevo</author>
		<pubDate>Thu, 25 Sep 2008 18:11:42 +0000</pubDate>
		<guid>http://myeasyscripts.com/loudbaking/beware-of-the-underscore/#comment-2731</guid>
		<description>&lt;p&gt;If you feed the set function with an array, the underscored words get camelCased. So your $foo_bar will be $fooBar. Camel cased variables are Cake's coding standart and this is probably done with the intention when putting a data array from the Model::find() operation to set().&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>If you feed the set function with an array, the underscored words get camelCased. So your $foo_bar will be $fooBar. Camel cased variables are Cake&#8217;s coding standart and this is probably done with the intention when putting a data array from the Model::find() operation to set().</p>]]></content:encoded>
	</item>
</channel>
</rss>
