Striped tables with Zend_View_Helper
I am currently working quite a lot with the Zend PHP Framework. I have grown to really like ZF (Zend Framework). While it does have a rather steep learning curve it is architected very neatly and offers lots of functionality for free.
I was recently constructing dynamic tables and wanted to give every other row a different class. Rather than clutter my view with logic to do this, I decided to create a custom view helper. I decided to make the view helper generic so it can be used to switch between two pieces of content each time it is called. This would mean I could use it for other things where alternating content is also needed.