title: Yii2 Horizontal form
body: <p>What I want to do is to change from bootstrap vertical to horizontal form and this is what I've tried:</p>
  
  <pre><code>&lt;?php $form = ActiveForm::begin([
      'layout' =&gt; 'horizontal',
      'action' =&gt; ['index'],
      'method' =&gt; 'get',
      'fieldConfig' =&gt; [
          'horizontalCssClasses' =&gt; [
              'label' =&gt; 'col-sm-2',
              'offset' =&gt; 'col-sm-offset-2',
              'wrapper' =&gt; 'col-sm-4',
          ],
      ],
  ]); ?&gt;
      &lt;div class="row"&gt;
          &lt;div class="col-md-6"&gt;
              &lt;?= $form-&gt;field($model, 'firstname') ?&gt;
              &lt;?= $form-&gt;field($model, 'lastname') ?&gt;
         &lt;/div&gt;
          &lt;div class="col-md-6"&gt;
              &lt;?= $form-&gt;field($model, 'email') ?&gt;
              &lt;?= $form-&gt;field($model, 'bla') ?&gt;
         &lt;/div&gt;
      &lt;/div&gt;
  &lt;?php ActiveForm::end() ?&gt;
  </code></pre>
  
  <p>but it gave me an error Setting unknown property: yii\widgets\ActiveForm::layout
  Please help!!!</p>