<?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>Promet CakePHP Source &#187; discovery</title>
	<atom:link href="http://cakephp.prometsupport.com/tag/discovery/feed/" rel="self" type="application/rss+xml" />
	<link>http://cakephp.prometsupport.com</link>
	<description></description>
	<lastBuildDate>Mon, 23 Feb 2009 08:03:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>What is compact() in controller?</title>
		<link>http://cakephp.prometsupport.com/2008/what-is-compact-in-controller/</link>
		<comments>http://cakephp.prometsupport.com/2008/what-is-compact-in-controller/#comments</comments>
		<pubDate>Fri, 23 May 2008 07:14:37 +0000</pubDate>
		<dc:creator>rachel</dc:creator>
				<category><![CDATA[CakePHP 1.2]]></category>
		<category><![CDATA[Tips & Tutorials]]></category>
		<category><![CDATA[compact]]></category>
		<category><![CDATA[discovery]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://cakephp.prometsupport.com/2008/05/23/what-is-compact-in-controller/</guid>
		<description><![CDATA[I don&#8217;t know how much functions in php I do not know but everyday I am finding new ones specially when I started tinkering CakePHP 1.2 last week. And my latest discovery is &#8230;. compact function. After using the console script, I found this code in the controllers $users = $this->User->Teacher->find('list'); $this->set(compact('users')); compact is a [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t know how much functions in php I do not know but everyday I am finding new ones specially when I started tinkering CakePHP 1.2 last week. And my latest discovery is &#8230;. compact function. After using the console script, I found this code in the controllers</p>
<p><code lang="php"><br />
$users = $this->User->Teacher->find('list');<br />
$this->set(compact('users'));</code></p>
<p><u>compact</u> is a native PHP function that creates an array containing variables and their values. <a href="http://www.littlehart.net/atthekeyboard/2007/08/07/stupid-cakephp-controller-tricks/">Chris Hartjes</a> explains it well in his blog. It&#8217;s quite neat because it will save me a few lines and spaces.</p>
<p>There you go, our new gem today: <a href="http://php.net/compact">compact()</a></p>
]]></content:encoded>
			<wfw:commentRss>http://cakephp.prometsupport.com/2008/what-is-compact-in-controller/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
