title: Yii2 give array fields names and save to database
body: <p>Can I give each item that will be saved to an array and then to a database a name.</p>
  
  <p>For example say I have three form fields which will be saved to the same array. 
  Can I setup my fields like below or if below is not correct what is the best way to do it?</p>
  
  <pre><code>echo $form-&gt;field($model, 'arrayfields')-&gt;textinput([
      'name'=&gt;'field1inarray[]',    
  ]);
  
  echo $form-&gt;field($model, 'arrayfields')-&gt;textinput([
      'name'=&gt;'field2inarray[]',    
  ]);
  
  echo $form-&gt;field($model, 'arrayfields')-&gt;textinput([
      'name'=&gt;'field3inarray[]',    
  ]);
  </code></pre>
  
  <p>Also how do I go about saving the array to my database in my controller/model?</p>