I would like to place form fields in Yii2 side by side, in a 2x2 grid.
I'm using the bootstrap/ActiveForm as such
<?php $form = ActiveForm::begin([
'layout' => 'horizontal',
'action' => ['index'],
'method' => 'get',
'fieldConfig' => [
'horizontalCssClasses' => [
'label' => 'col-sm-2',
'offset' => 'col-sm-offset-2',
'wrapper' => 'col-sm-4',
],
],
]); ?>
The fields are basically a series of date widgets
<?= $form->field($model, 'saleFrom')->widget(DatePicker::className(), [
'options' => ['placeholder' => 'TO'],
'pluginOptions' => [
'autoclose' => true,
'format' => 'yyyy-mm-dd'
]
]); ?>
However all that has managed to do is align all four fields to the left of the div - i can't figure out from the documentation how to use the Yii2 options to do this without having to manually add custom css.