kartik-v / yii2-widget-activeform

Enhanced Yii2 active-form and active-field with full bootstrap styling support (sub repo split from yii2-widgets).
http://demos.krajee.com/widget-details/active-form
Other
64 stars 35 forks source link

Issue: Cannot control size of fields #53

Closed mhashimmaqbool closed 8 years ago

mhashimmaqbool commented 9 years ago

I've been unable to found any option that provide size control of field. I checked in your classes, it seems to me used with full span property of active form.

$errorDivClass = "col-{$size}-{$this->form->fullSpan}"; $inputDivClass = $errorDivClass;

is there anyway that I add class to active field and it behaves accordingly?

Like this:

<?= $form->field($model, 'att', ['inputDivClass' => 'col-lg-5'])->dropDownList($jsonArr); ?>

This is my form tag:

<?php $form = ActiveForm::begin([ 'id' => 'question-create', 'type' => ActiveForm::TYPE_HORIZONTAL, 'formConfig' => ['labelSpan' => 3, 'deviceSize' => ActiveForm::SIZE_SMALL] ]); ?>

kartik-v commented 9 years ago

Yes this is the way it should work.