<?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: Note to CodeIgniter nerds: please, no looping code in your views.</title>
	<atom:link href="http://www.killerphp.com/articles/note-to-codeigniter-nerds-please-no-looping-code-in-your-views/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.killerphp.com/articles/note-to-codeigniter-nerds-please-no-looping-code-in-your-views/</link>
	<description>Dedicated to teaching web designers PHP.</description>
	<lastBuildDate>Mon, 29 Aug 2011 11:56:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Mikele</title>
		<link>http://www.killerphp.com/articles/note-to-codeigniter-nerds-please-no-looping-code-in-your-views/comment-page-1/#comment-134558</link>
		<dc:creator>Mikele</dc:creator>
		<pubDate>Tue, 16 Nov 2010 10:10:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.killerphp.com/articles/note-to-codeigniter-nerds-please-no-looping-code-in-your-views/#comment-134558</guid>
		<description>I always ask my designers to send me their work in graphic format. 

Designers should not touch HTML/CSS. They don&#039;t like to do it and they do it wrong. Even if HTML/CSS isn&#039;t programming, it&#039;s more likely that a programmer will do it better, cause it involves typing code and that&#039;s what a programmer likes to do.

That&#039;s why I like to include all my display logic in Views. Views ARE programming, just like Controllers and Models. They just do different things.</description>
		<content:encoded><![CDATA[<p>I always ask my designers to send me their work in graphic format. </p>
<p>Designers should not touch HTML/CSS. They don&#8217;t like to do it and they do it wrong. Even if HTML/CSS isn&#8217;t programming, it&#8217;s more likely that a programmer will do it better, cause it involves typing code and that&#8217;s what a programmer likes to do.</p>
<p>That&#8217;s why I like to include all my display logic in Views. Views ARE programming, just like Controllers and Models. They just do different things.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stefan Mischook</title>
		<link>http://www.killerphp.com/articles/note-to-codeigniter-nerds-please-no-looping-code-in-your-views/comment-page-1/#comment-134512</link>
		<dc:creator>Stefan Mischook</dc:creator>
		<pubDate>Tue, 16 Nov 2010 04:07:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.killerphp.com/articles/note-to-codeigniter-nerds-please-no-looping-code-in-your-views/#comment-134512</guid>
		<description>My suggested widgets don&#039;t lock away anything from the designer. All the table rows and cells in the widget can be easily styled with simple CSS. 

... You could even add a few parameters if you liked for things like order.

Thanks for the comment.

Stefan</description>
		<content:encoded><![CDATA[<p>My suggested widgets don&#8217;t lock away anything from the designer. All the table rows and cells in the widget can be easily styled with simple CSS. </p>
<p>&#8230; You could even add a few parameters if you liked for things like order.</p>
<p>Thanks for the comment.</p>
<p>Stefan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Phil Sturgeon</title>
		<link>http://www.killerphp.com/articles/note-to-codeigniter-nerds-please-no-looping-code-in-your-views/comment-page-1/#comment-134458</link>
		<dc:creator>Phil Sturgeon</dc:creator>
		<pubDate>Mon, 15 Nov 2010 20:53:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.killerphp.com/articles/note-to-codeigniter-nerds-please-no-looping-code-in-your-views/#comment-134458</guid>
		<description>This is a horrible approach that stop designers from doing their job, pollute controllers with presentation logic and generally waste a lot of time. 

For Widgets that is one thing, I have a widget implementation I use on PyroCMS and converted over to EE but those are for tiny partials that can be styled with CSS.

As a general approach you will madden your designers by restricting the HTML they can use. If it is all locked away then you are just complicating the issue for everyone!

Besides, you have to wonder just how dumbed down you need to make view files for designers. Sure maybe they could mess some stuff up, but I have worked with plenty of designers that have no problems with foreach loops.

Right now I am working with a designer who has just pulled down a Ruby on Rails site using Git and is working his way through the views. He&#039;s never used Rails before, but he has common sense.

If you want to overly complicate the design of your applications purely because the designers you work with have no common sense, then that is up to you. Personally, I would just find better designers.</description>
		<content:encoded><![CDATA[<p>This is a horrible approach that stop designers from doing their job, pollute controllers with presentation logic and generally waste a lot of time. </p>
<p>For Widgets that is one thing, I have a widget implementation I use on PyroCMS and converted over to EE but those are for tiny partials that can be styled with CSS.</p>
<p>As a general approach you will madden your designers by restricting the HTML they can use. If it is all locked away then you are just complicating the issue for everyone!</p>
<p>Besides, you have to wonder just how dumbed down you need to make view files for designers. Sure maybe they could mess some stuff up, but I have worked with plenty of designers that have no problems with foreach loops.</p>
<p>Right now I am working with a designer who has just pulled down a Ruby on Rails site using Git and is working his way through the views. He&#8217;s never used Rails before, but he has common sense.</p>
<p>If you want to overly complicate the design of your applications purely because the designers you work with have no common sense, then that is up to you. Personally, I would just find better designers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian</title>
		<link>http://www.killerphp.com/articles/note-to-codeigniter-nerds-please-no-looping-code-in-your-views/comment-page-1/#comment-117987</link>
		<dc:creator>Brian</dc:creator>
		<pubDate>Mon, 28 Jun 2010 07:48:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.killerphp.com/articles/note-to-codeigniter-nerds-please-no-looping-code-in-your-views/#comment-117987</guid>
		<description>This may be interesting to some readers: shows the practical implementation of moving presentation logic out of views.

http://www.devshed.com/c/a/PHP/Moving-Presentation-Logic-Out-of-Views-with-Code-Igniter/

As an aside, yes looping code is easy and everyone should know it but that has little to do with whether designers should be expected to edit server side code and everything to do with the .com boom over. Nowadays, a graphics artist is indispensable, a web developer too. However a web designer has become a euphemism (unfortunately) for a poorly qualified web developer. Unless you&#039;re working in a large corporation with clearly defined roles, the web developer these days is expected to take care of Javascript (especially with advanced Javascript libraries: there is more out there than jQuery) and most heavy duty front end lifting. So the &quot;middleman&quot; web designer is dying out. Who is left? The graphics artist, who knows even less HTML and CSS and absolutely no Javascript or first principles in programming at all, who spends most of his time in photoshop. This person absolutely should not be allowed to touch backend code, and he should not waste his time on it.

So in summary: advanced javascript libraries means backend developers are constantly touching views. And market trends means the title of &quot;web designer&quot; is going extinct and everyone knows a little code. But that doesn&#039;t mean less need for separation of business and presentation logic; in fact, there is much more.</description>
		<content:encoded><![CDATA[<p>This may be interesting to some readers: shows the practical implementation of moving presentation logic out of views.</p>
<p><a href="http://www.devshed.com/c/a/PHP/Moving-Presentation-Logic-Out-of-Views-with-Code-Igniter/" rel="nofollow">http://www.devshed.com/c/a/PHP/Moving-Presentation-Logic-Out-of-Views-with-Code-Igniter/</a></p>
<p>As an aside, yes looping code is easy and everyone should know it but that has little to do with whether designers should be expected to edit server side code and everything to do with the .com boom over. Nowadays, a graphics artist is indispensable, a web developer too. However a web designer has become a euphemism (unfortunately) for a poorly qualified web developer. Unless you&#8217;re working in a large corporation with clearly defined roles, the web developer these days is expected to take care of Javascript (especially with advanced Javascript libraries: there is more out there than jQuery) and most heavy duty front end lifting. So the &#8220;middleman&#8221; web designer is dying out. Who is left? The graphics artist, who knows even less HTML and CSS and absolutely no Javascript or first principles in programming at all, who spends most of his time in photoshop. This person absolutely should not be allowed to touch backend code, and he should not waste his time on it.</p>
<p>So in summary: advanced javascript libraries means backend developers are constantly touching views. And market trends means the title of &#8220;web designer&#8221; is going extinct and everyone knows a little code. But that doesn&#8217;t mean less need for separation of business and presentation logic; in fact, there is much more.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stefan Mischook</title>
		<link>http://www.killerphp.com/articles/note-to-codeigniter-nerds-please-no-looping-code-in-your-views/comment-page-1/#comment-115459</link>
		<dc:creator>Stefan Mischook</dc:creator>
		<pubDate>Sat, 05 Jun 2010 16:00:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.killerphp.com/articles/note-to-codeigniter-nerds-please-no-looping-code-in-your-views/#comment-115459</guid>
		<description>&quot;wouldn’t it make more sense to change this markup in the view file, rather than a model or controller?&quot;

Theory vs practice. I have found in practice that web designers can mess up looping code. The better solution is to have a widget building class where you can specify the list type you want with a simple function call or argument. 

S</description>
		<content:encoded><![CDATA[<p>&#8220;wouldn’t it make more sense to change this markup in the view file, rather than a model or controller?&#8221;</p>
<p>Theory vs practice. I have found in practice that web designers can mess up looping code. The better solution is to have a widget building class where you can specify the list type you want with a simple function call or argument. </p>
<p>S</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pingu</title>
		<link>http://www.killerphp.com/articles/note-to-codeigniter-nerds-please-no-looping-code-in-your-views/comment-page-1/#comment-115435</link>
		<dc:creator>Pingu</dc:creator>
		<pubDate>Sat, 05 Jun 2010 07:44:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.killerphp.com/articles/note-to-codeigniter-nerds-please-no-looping-code-in-your-views/#comment-115435</guid>
		<description>Personally, I don&#039;t have any gripes with looping in views, especially where markup is involved. I think that if an element includes markup, then it&#039;s better displayed in the view rather than hidden behind a model or controller - personally I feel that Models and Controllers should be returning data only.

For example, imagine if you displayed something as a definition list once, and later on down the track decided that it would be better suited as a table - wouldn&#039;t it make more sense to change this markup in the view file, rather than a model or controller?</description>
		<content:encoded><![CDATA[<p>Personally, I don&#8217;t have any gripes with looping in views, especially where markup is involved. I think that if an element includes markup, then it&#8217;s better displayed in the view rather than hidden behind a model or controller &#8211; personally I feel that Models and Controllers should be returning data only.</p>
<p>For example, imagine if you displayed something as a definition list once, and later on down the track decided that it would be better suited as a table &#8211; wouldn&#8217;t it make more sense to change this markup in the view file, rather than a model or controller?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mikey</title>
		<link>http://www.killerphp.com/articles/note-to-codeigniter-nerds-please-no-looping-code-in-your-views/comment-page-1/#comment-109737</link>
		<dc:creator>Mikey</dc:creator>
		<pubDate>Mon, 22 Mar 2010 12:37:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.killerphp.com/articles/note-to-codeigniter-nerds-please-no-looping-code-in-your-views/#comment-109737</guid>
		<description>Hi,
I&#039;d just like to correct you on a few points.

Firstly an MVC framework is to separate domain level processing from the GUI. (NOT to enable designers to edit the views).

Views ARE NOT intended to be keep as much PHP code out of templates, only to remove data retrieval and processing from them.

There is absolutely nothing wrong with having loops in Views (infact its expected). If this makes it easier for designers to break them then, well, don&#039;t let designers write your code for you!

Codeignitor is an excellent framework, just look at how many sites use it, it also gives you much more freedom compared to other MVC frameworks.</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I&#8217;d just like to correct you on a few points.</p>
<p>Firstly an MVC framework is to separate domain level processing from the GUI. (NOT to enable designers to edit the views).</p>
<p>Views ARE NOT intended to be keep as much PHP code out of templates, only to remove data retrieval and processing from them.</p>
<p>There is absolutely nothing wrong with having loops in Views (infact its expected). If this makes it easier for designers to break them then, well, don&#8217;t let designers write your code for you!</p>
<p>Codeignitor is an excellent framework, just look at how many sites use it, it also gives you much more freedom compared to other MVC frameworks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stefan Mischook</title>
		<link>http://www.killerphp.com/articles/note-to-codeigniter-nerds-please-no-looping-code-in-your-views/comment-page-1/#comment-100484</link>
		<dc:creator>Stefan Mischook</dc:creator>
		<pubDate>Sat, 24 Oct 2009 12:07:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.killerphp.com/articles/note-to-codeigniter-nerds-please-no-looping-code-in-your-views/#comment-100484</guid>
		<description>&quot;I think the video you speak of is just to demonstrate how to create a basic page. It doesn’t actually use the MVC approach.&quot;

Hi,

I guess you are talking about the CodeIgniter video? 

Thanks for the comment.

Stef</description>
		<content:encoded><![CDATA[<p>&#8220;I think the video you speak of is just to demonstrate how to create a basic page. It doesn’t actually use the MVC approach.&#8221;</p>
<p>Hi,</p>
<p>I guess you are talking about the CodeIgniter video? </p>
<p>Thanks for the comment.</p>
<p>Stef</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: phil</title>
		<link>http://www.killerphp.com/articles/note-to-codeigniter-nerds-please-no-looping-code-in-your-views/comment-page-1/#comment-100471</link>
		<dc:creator>phil</dc:creator>
		<pubDate>Sat, 24 Oct 2009 10:05:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.killerphp.com/articles/note-to-codeigniter-nerds-please-no-looping-code-in-your-views/#comment-100471</guid>
		<description>I&#039;ve just stumbled on this while looking for something else completely - but going back to the initial article:

I think the video you speak of is just to demonstrate how to create a basic page. It doesn&#039;t actually use the MVC approach.

Next, if you don&#039;t want PHP in your view (like me), then just use the parser class and keep all php away from your view.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve just stumbled on this while looking for something else completely &#8211; but going back to the initial article:</p>
<p>I think the video you speak of is just to demonstrate how to create a basic page. It doesn&#8217;t actually use the MVC approach.</p>
<p>Next, if you don&#8217;t want PHP in your view (like me), then just use the parser class and keep all php away from your view.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Weiss</title>
		<link>http://www.killerphp.com/articles/note-to-codeigniter-nerds-please-no-looping-code-in-your-views/comment-page-1/#comment-97285</link>
		<dc:creator>Steve Weiss</dc:creator>
		<pubDate>Thu, 03 Sep 2009 05:56:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.killerphp.com/articles/note-to-codeigniter-nerds-please-no-looping-code-in-your-views/#comment-97285</guid>
		<description>I have a bone to pick with this one... 

My designers all easily understand the concept of a loop. Often times, for various reasons, they need to drop in an extra blank table cell in the middle of every row or toss in a checkbox for this one special thing or they in some other way need to add extra stuff to the table, including manipulating the individual rows.

To be honest, when we try and abstract things out like the author suggests, it&#039;s just like so many here have already said - the designer will come back to you over and over again and ask you to change it.  It&#039;s not as simple as you make it out to be.  CSS really does not always cut it, especially in a world that still includes IE 6.  Maybe if people really do get their act together on some standards, and we get CSS3 and HTML5, and manna falls from the heavens, in a decade, perhaps, but there&#039;s a reality that trumps anything the W3C might want to dream up in this regard.  Honestly, even Safari can&#039;t do everything in CSS yet.  You simply cannot manipulate a table every which way without getting down to the row-level detail in the HTML - CSS only allows so much - not without nth-child accessors and the like, at least.  Building helpers to get around this is needlessly overcomplicated and difficult to explain to designers when they generally easily understand the concept of foreach: endforeach;, and all understand basic HTML.  I&#039;m finding it difficult to imagine the designer who can&#039;t get it, and have not had my designers &quot;bust&quot; my code anywhere near as frequently as you&#039;ve suggested.  Get SVN, and a deployment system... they shouldn&#039;t be working on your production code anyway.  If the site stops working, it&#039;s almost never their fault.</description>
		<content:encoded><![CDATA[<p>I have a bone to pick with this one&#8230; </p>
<p>My designers all easily understand the concept of a loop. Often times, for various reasons, they need to drop in an extra blank table cell in the middle of every row or toss in a checkbox for this one special thing or they in some other way need to add extra stuff to the table, including manipulating the individual rows.</p>
<p>To be honest, when we try and abstract things out like the author suggests, it&#8217;s just like so many here have already said &#8211; the designer will come back to you over and over again and ask you to change it.  It&#8217;s not as simple as you make it out to be.  CSS really does not always cut it, especially in a world that still includes IE 6.  Maybe if people really do get their act together on some standards, and we get CSS3 and HTML5, and manna falls from the heavens, in a decade, perhaps, but there&#8217;s a reality that trumps anything the W3C might want to dream up in this regard.  Honestly, even Safari can&#8217;t do everything in CSS yet.  You simply cannot manipulate a table every which way without getting down to the row-level detail in the HTML &#8211; CSS only allows so much &#8211; not without nth-child accessors and the like, at least.  Building helpers to get around this is needlessly overcomplicated and difficult to explain to designers when they generally easily understand the concept of foreach: endforeach;, and all understand basic HTML.  I&#8217;m finding it difficult to imagine the designer who can&#8217;t get it, and have not had my designers &#8220;bust&#8221; my code anywhere near as frequently as you&#8217;ve suggested.  Get SVN, and a deployment system&#8230; they shouldn&#8217;t be working on your production code anyway.  If the site stops working, it&#8217;s almost never their fault.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

