title: Extending Zend View Helper Placeholder
body: <p>I was reading the manual about <a href="http://zendframework.com/manual/en/learning.view.placeholders.basics.html" rel="nofollow noreferrer">basic placeholder usage</a>, and it has this example:</p>
  
  <pre><code>class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
  {
      // ...
  
      protected function _initSidebar()
      {
          $this-&gt;bootstrap('View');
          $view = $this-&gt;getResource('View');
  
          $view-&gt;placeholder('sidebar')
               // "prefix" -&gt; markup to emit once before all items in collection
               -&gt;setPrefix("&lt;div class=\"sidebar\"&gt;\n    &lt;div class=\"block\"&gt;\n")
               // "separator" -&gt; markup to emit between items in a collection
               -&gt;setSeparator("&lt;/div&gt;\n    &lt;div class=\"block\"&gt;\n")
               // "postfix" -&gt; markup to emit once after all items in a collection
               -&gt;setPostfix("&lt;/div&gt;\n&lt;/div&gt;");
      }
  
      // ...
  }
  </code></pre>
  
  <p>I want to accomplish almost exactly that, but I'd like to conditionally add more class values to the repeating <code>div</code>s, at time of rendering if possible, when all the content is in the placeholder. One thing I specifically want to do is add the class of "first" to the first element and "last" to the last element. I assume that I'll have to extend the <code>Zend_View_Helper_Placeholder</code> class to accomplish this.</p>