<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Wed, 09 Jul 2008 07:16:00 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Stefan Mischook's Blog: Note to CodeIgniter nerds: please, no looping code in your views.]]></title>
      <guid>http://www.phpdeveloper.org/news/10356</guid>
      <link>http://www.phpdeveloper.org/news/10356</link>
      <description><![CDATA[<p>
<i>Stefan Mischook</i> so eloquently expresses his opinion on a method for looping in the CodeIgniter framework in <a href="http://www.killerphp.com/articles/note-to-codeigniter-nerds-please-no-looping-code-in-your-views/">this new post</a> to the KillerPHP blog today, "Note to CodeIgniter nerds: please, no looping code in your views."
</p>
<blockquote>
I was researching things 'nerd' on the Web today, and I found myself at the CodeIgniter website. [...] I'm wondering about CodeIgniter's decision to place PHP looping code in their views.
</blockquote>
<p>
He notes that the whole point of the View in the Model/View/Controller framework is to keep as much PHP out of it as possible. In <a href="http://codeigniter.com/tutorials/watch/intro/">their example</a> they show just the opposite. Some of <a href="http://www.killerphp.com/articles/note-to-codeigniter-nerds-please-no-looping-code-in-your-views/#comments">the comments</a> agree with his post, noting that this is in fact the point of the View. Others, however, point out that code in the View, especially looping code is something necessary to output multiple items being passed out.
</p>]]></description>
      <pubDate>Fri, 06 Jun 2008 08:43:53 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Developer Tutorials Blog: PHP array_walk(): Run an array through a function]]></title>
      <guid>http://www.phpdeveloper.org/news/10020</guid>
      <link>http://www.phpdeveloper.org/news/10020</link>
      <description><![CDATA[<p>
The Developer Tutorials blog has a <a href="http://www.developertutorials.com/blog/php/php-functions/php-array_walk-run-an-array-through-a-function-128/">quick example</a> of how to use the array_walk function to maneuver through the array of your choosing and applying a callback method to each of its elements.
</p>
<blockquote>
It’s a common sight: taking an array and running (well, walking) its elements through a particular function. Luckily, PHP provides a simple yet powerful function to overcome this: array_walk().
</blockquote>
<p>
They include an example, giving a sample "some_function" the array_walk method uses when it's called, replacing a foreach (or other type of loop). Plus you can specify an object with the callback to run it against a method inside a class too.
</p>]]></description>
      <pubDate>Wed, 23 Apr 2008 08:47:09 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Arnold Daniels' Blog: Improve performace: check your loops]]></title>
      <guid>http://www.phpdeveloper.org/news/9506</guid>
      <link>http://www.phpdeveloper.org/news/9506</link>
      <description><![CDATA[<p>
<i>Arnold Daniels</i> has <a href="http://blog.adaniels.nl/articles/improve-performace-check-your-loops/">a suggestion</a> for developers out there to help improve the performance of their applications - check your loops.
</p>
<blockquote>
So you have a script which is not performing the way you want to. The first thing you should do it try to find out what the problem is. There are some tools out there that can help you.
</blockquote>
<p>
He mentions the profiler in <a href="http://www.zend.com/en/products/studio/">Zend Studio</a> as well as the <a href="http://xdebug.org/docs/profiler">one in XDebug</a>. If you can't install those, however, he has another suggestion - <a href="http://www.firephp.org/">FirePHP</a> (a tool that can help time execution times in a simple and easy to include way.
</p>
<p>
With tools in hand, he offers a few suggestions as to what to check for and do in your applications:
</p>
<ul>
<li>Get the data ready before going into the loop
<li>Don't do things in the loop, you can also do outside it
<li>Use create_function to aid you
<li>Be careful with abstraction in loops
<li>Sometimes you can prevent loops altogether
<li>Last resort: write an extension
</ul>]]></description>
      <pubDate>Mon, 28 Jan 2008 12:14:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[MSBWare.com: Alternating Row Colors]]></title>
      <guid>http://www.phpdeveloper.org/news/7760</guid>
      <link>http://www.phpdeveloper.org/news/7760</link>
      <description><![CDATA[<p>
Sometimes, a simple approach is the best. That's what <i>Michael Berman</i> went with in <a href="http://www.msbware.com/articles/PHP_Alternating_Row_Colors_1.html">this light and easy tutorial</a>. It focuses on the creation of an "alternating rows" script with PHP.
</p>
<blockquote>
This concept is used all over the internet.  Almost every database driven website uses alternating row colors when displaying a list of records.  You've seen it used, you like it, and now you want to do it yourself.  But, you're not sure how to accomplish it.  Well you've come to the right place.  I'm going to discuss the basic idea behind achieving this and give some concrete examples demonstrating different ways to implement it.
</blockquote>
<p>
The <a href="http://www.msbware.com/articles/PHP_Alternating_Row_Colors_1.html">example code</a> show how to alternate between two colors - white and grey - for the background of a series of DIVs. He even includes a series of tests to show which method of switching them out would be faster (while loop, for loop, etc).
</p>]]></description>
      <pubDate>Wed, 02 May 2007 16:13:00 -0500</pubDate>
    </item>
  </channel>
</rss>
