<?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>damonky.co.uk &#187; renderElement</title>
	<atom:link href="http://www.damonky.co.uk/tag/renderelement/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.damonky.co.uk</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sun, 04 Apr 2010 19:31:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Getting back into cakePHP</title>
		<link>http://www.damonky.co.uk/uncategorized/getting-back-into-cakephp/</link>
		<comments>http://www.damonky.co.uk/uncategorized/getting-back-into-cakephp/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 12:47:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[1.2]]></category>
		<category><![CDATA[cakePHP]]></category>
		<category><![CDATA[Fat models]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[renderElement]]></category>
		<category><![CDATA[skinny controllers]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://damonky.co.uk/2008/06/getting-back-into-cakephp/</guid>
		<description><![CDATA[I have just started an internal project at work to create a portfolio management system. After several months of Joomla hacking it seems this is my chance to get back into serious development again.
I have gone for cakePHP for the project, as opposed to Codeigniter. Although I have mainly tended towards codeigniter in the past [...]]]></description>
			<content:encoded><![CDATA[<p>I have just started an internal project at work to create a portfolio management system. After several months of Joomla hacking it seems this is my chance to get back into serious development again.</p>
<p>I have gone for <a target="_blank" href="http://www.cakephp.org">cakePHP</a> for the project, as opposed to <a target="_blank" href="http://www.codeigniter.com">Codeigniter</a>. Although I have mainly tended towards codeigniter in the past for applications, It has been a while since i have really used cake i was drawn in by cakePHP&#8217;s features.</p>
<p>One feature i am finding particularly useful is the elements (using renderElement), as a lot of the forms use similar listings. Instead of using requestAction, I load the data into a standard variable (e.g: $campaigns, for campaigns) from either data already loaded or  direct from a custom function in the model. This removes the need to call a particular view from within the element and reduces the bloating of the controller as suggested by the article <a target="_blank" href="http://weblog.jamisbuck.org/2006/10/18/skinny-controller-fat-model">Skinny Controller, Fat Model</a>. </p>
<p>Jamis says:<br />
<blockquote>Be aggressive! Try to keep your controller actions and views as slim as<br />
possible. A one-line action is a thing of wonder, as is a template that<br />
is mostly <span class="caps">HTML</span>. It is also <em>much</em> more maintainable than a view that is full of assignment statements and chained method calls.</p></blockquote>
<p>I have found that this approach has indeed made my life a lot easier, It&#8217;s soo easy to get tangled up in controllers, and sometimes reapeating code when there is simply no need.</p>
<p>I haven&#8217;t tried to understand the paging yet, but based on a couple blogs I&#8217;ve read, it works the same as the find command, although I&#8217;m not sure how paging would work with several tables on the page &#8211; I guess I&#8217;ll find out in the next few days.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.damonky.co.uk/uncategorized/getting-back-into-cakephp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
