Emagister/zend-form-decorators-bootstrap

How do I add multiple controls per element?

martinbean opened this issue · 3 comments

I couldn't find this in the documentation any where, but how do I add two controls to an element? Think a property search form, where you have select options for price. My mark-up would be like:

<div class="control-group">
  <div class="control-label">Price</div>
  <div class="controls">
    <select name="min_price" id="min_price">
      <option value="0">Select:</option>
      <!-- rest of price options -->
    </select>
    <select name="max_price" id="max_price">
      <option value="0">Select:</option>
      <!-- rest of price options -->
    </select>
  </div>
</div>

How would I replicate this using this library in Zend Framework?

Currently, this is not supported. Maybe This could be replicated by using a custom display group that override the element decorators to exclude the HtmlTag and the Label decorators (they are both responsible to render the "control-label" and the "controls" div elements) and add each of these as a decorators of that custom display group.

@theUniC Hi, Christian. Thanks for getting back so quickly. I think I follow and shall give it a go and let you know how I get on. Thanks again.

Sure! Let me know when you're done! Will be interesting to see! :)