<?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: Zero items vs. x items in a view</title>
	<atom:link href="http://cakebaker.42dh.com/2007/10/02/zero-items-vs-x-items-in-a-view/feed/" rel="self" type="application/rss+xml" />
	<link>http://cakebaker.42dh.com/2007/10/02/zero-items-vs-x-items-in-a-view/</link>
	<description>baking cakes with CakePHP</description>
	<lastBuildDate>Wed, 28 Jul 2010 19:06:52 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2007/10/02/zero-items-vs-x-items-in-a-view/comment-page-1/#comment-19157</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Thu, 11 Oct 2007 07:45:26 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/10/02/zero-items-vs-x-items-in-a-view/#comment-19157</guid>
		<description>@Abba Bryant: Thanks for your comment!

I think it depends on the situation whether your solution is overkill. If you add this functionality to almost each element, then it is probably overkill ;-)</description>
		<content:encoded><![CDATA[<p>@Abba Bryant: Thanks for your comment!</p>
<p>I think it depends on the situation whether your solution is overkill. If you add this functionality to almost each element, then it is probably overkill ;-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abba Bryant</title>
		<link>http://cakebaker.42dh.com/2007/10/02/zero-items-vs-x-items-in-a-view/comment-page-1/#comment-18571</link>
		<dc:creator>Abba Bryant</dc:creator>
		<pubDate>Mon, 08 Oct 2007 21:51:06 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/10/02/zero-items-vs-x-items-in-a-view/#comment-18571</guid>
		<description>I know it&#039;s overkill but I tend to create an element that can either recieve the posts data or query for it if the data isn&#039;t provided.

I like to keep my view logicless ( as in that anything with embedded display logic comes in via a renderElement call )

Using the reusable requestAction trick and some cacheing as well as being very careful when i let the view grab the data or the controller. I find this works quite well.

Also if you never see a requestAction or more than a couple of lines of concurrent php in a view file. If you need to find the logic its in the elements folder in subfolders named by controller.

Easy.</description>
		<content:encoded><![CDATA[<p>I know it&#8217;s overkill but I tend to create an element that can either recieve the posts data or query for it if the data isn&#8217;t provided.</p>
<p>I like to keep my view logicless ( as in that anything with embedded display logic comes in via a renderElement call )</p>
<p>Using the reusable requestAction trick and some cacheing as well as being very careful when i let the view grab the data or the controller. I find this works quite well.</p>
<p>Also if you never see a requestAction or more than a couple of lines of concurrent php in a view file. If you need to find the logic its in the elements folder in subfolders named by controller.</p>
<p>Easy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2007/10/02/zero-items-vs-x-items-in-a-view/comment-page-1/#comment-17340</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Thu, 04 Oct 2007 15:42:41 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/10/02/zero-items-vs-x-items-in-a-view/#comment-17340</guid>
		<description>@all: Thanks for your comments!

@SebJ: As the others already said, it depends on the situation. If it is only a little bit of text that&#039;s different, than it is overkill to create three views. On the other hand if you have for each case a full-fledged page with specific information, then it&#039;s imho better to create separate views.</description>
		<content:encoded><![CDATA[<p>@all: Thanks for your comments!</p>
<p>@SebJ: As the others already said, it depends on the situation. If it is only a little bit of text that&#8217;s different, than it is overkill to create three views. On the other hand if you have for each case a full-fledged page with specific information, then it&#8217;s imho better to create separate views.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: speedmax</title>
		<link>http://cakebaker.42dh.com/2007/10/02/zero-items-vs-x-items-in-a-view/comment-page-1/#comment-16807</link>
		<dc:creator>speedmax</dc:creator>
		<pubDate>Tue, 02 Oct 2007 12:27:51 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/10/02/zero-items-vs-x-items-in-a-view/#comment-16807</guid>
		<description>Considering, the amount of view data is required.. usually trivial message, it would make sense to group them together.. 


depends on the complexity of the view i guess, for simple &quot;no found&quot; message, many would agree to go the second approach, whereas a complex not found view with suggested information such as ebay or google not-found view.. probably the first approach.


that is why many template engine, there is a presentational construct loop-else for view. for example, h2o template which i created use following syntax.

{% for post in posts %}
   {{ post.name }}
   {{ post.content }}
{% else %}
     there a currently not blog posts 
{% endfor%}</description>
		<content:encoded><![CDATA[<p>Considering, the amount of view data is required.. usually trivial message, it would make sense to group them together.. </p>
<p>depends on the complexity of the view i guess, for simple &#8220;no found&#8221; message, many would agree to go the second approach, whereas a complex not found view with suggested information such as ebay or google not-found view.. probably the first approach.</p>
<p>that is why many template engine, there is a presentational construct loop-else for view. for example, h2o template which i created use following syntax.</p>
<p>{% for post in posts %}<br />
   {{ post.name }}<br />
   {{ post.content }}<br />
{% else %}<br />
     there a currently not blog posts<br />
{% endfor%}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JMG</title>
		<link>http://cakebaker.42dh.com/2007/10/02/zero-items-vs-x-items-in-a-view/comment-page-1/#comment-16802</link>
		<dc:creator>JMG</dc:creator>
		<pubDate>Tue, 02 Oct 2007 11:56:11 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/10/02/zero-items-vs-x-items-in-a-view/#comment-16802</guid>
		<description>I generally use the first solution; but if the view tends to turn into a blank slate, I create an specific view. This is a case-by-case situation.</description>
		<content:encoded><![CDATA[<p>I generally use the first solution; but if the view tends to turn into a blank slate, I create an specific view. This is a case-by-case situation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SebJ</title>
		<link>http://cakebaker.42dh.com/2007/10/02/zero-items-vs-x-items-in-a-view/comment-page-1/#comment-16780</link>
		<dc:creator>SebJ</dc:creator>
		<pubDate>Tue, 02 Oct 2007 09:07:54 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/10/02/zero-items-vs-x-items-in-a-view/#comment-16780</guid>
		<description>It&#039;s a nerverending debate, but as it&#039;s &quot;presentation logic&quot;, I&#039;ll go for the 2nd approach.
Another example, what if there is &quot;no post&quot; &#124; &quot;1 post&quot; &#124; &quot;more posts&quot;?
I prefer an if-elseif-else condition in the view, and not 3 views.</description>
		<content:encoded><![CDATA[<p>It&#8217;s a nerverending debate, but as it&#8217;s &#8220;presentation logic&#8221;, I&#8217;ll go for the 2nd approach.<br />
Another example, what if there is &#8220;no post&#8221; | &#8220;1 post&#8221; | &#8220;more posts&#8221;?<br />
I prefer an if-elseif-else condition in the view, and not 3 views.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
