title: Yii2 Loading and saving ActiveForm
body: <p>Model:</p>
  
  <pre><code>class Team extends ActiveRecord {
      public function rules() {
          return [
              [['code', 'name'], 'required'],
          ];
      }
  }
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>class TeamController extends ActiveController {
      public $modelClass = 'frontend\models\Team';
      protected function verbs(){
          return [
              'create' =&gt; ['POST'],
          ];
      }
  }
  </code></pre>
  
  <p>View:</p>
  
  <pre><code>&lt;?php Pjax::begin(['id' =&gt; 'new_team']) ?&gt;
  &lt;?php $form = ActiveForm::begin(['action' =&gt; 'team/create'], 'options' =&gt; ['data-pjax' =&gt; true ]]); ?&gt;
      &lt;?= $form-&gt;field($model, 'code')-&gt;textInput() ?&gt;
      &lt;?= $form-&gt;field($model, 'name')-&gt;textInput() ?&gt;
      &lt;div class="form-group"&gt;
          &lt;?= Html::submitButton(Yii::t('app', 'Create'), ['class' =&gt; 'btn btn-success']) ?&gt;
      &lt;/div&gt;
  &lt;?php ActiveForm::end(); ?&gt;
  &lt;?php Pjax::end(); ?&gt;
  </code></pre>
  
  <p>Form's fields will have Team[code] and Team[name] as name attribute values. I would like them to be name="code" and name="name" instead. At the moment when I submit the form I get:</p>
  
  <pre><code>[{"field":"code",
    "message":"Code cannot be blank."},
   {"field":"name",
    "message":"Name cannot be blank."}]
  </code></pre>
  
  <p>How can I change name attribute's value?</p>