Question

can someone explain me the difference? Collection can be many fieldsets? And fieldsets is the "collection" of elements?

I'm right?

Was it helpful?

Solution

HTML allows you to group related form fields with the help of the <fieldset> tag, as shown in the example below. The optional <legend> tag allows you to define the caption for the group.

<fieldset>
  <legend>Choose a payment method:</legend>
  <input type="radio" name="payment" value="paypal">PayPal</input>
  <input type="radio" name="payment" value="card">Credit Card</input>
</fieldset>

In Zend Framework 2, the term "fieldset" means the same thing as in HTML - it allows you to define a group of form elements. Moreover, the entire form can be considered as a fieldset.

In Zend Framework 2, the term "collection" is analogous to fieldset, because it allows you to group related form elements. But, it is designed for adding form elements dynamically by binding an array of objects to the form elements.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top