Closed WJRovers closed 8 years ago
the workaround is use addClass property but you must also add default class 'form-control'
@nicovicz Are you sure this works?, haven't tested it myself yet.
The default class is 'form-control' so adding a class should ''add'' not ''set'' the classes, so that seems like bad a bad name for the function if it does that. On top of that it is really hard to style the input field. The add-class can only be called on the surrounding container (the form in this case).
Since the kartikk ActiveField extends the Yii2/ActiveField I expected it to just support the base functionalities. Guess it can only be done with a 'workaround'...
One of the following would work for your use case
addClass
property to form-control test
, OR echo $form->field($model, 'value')->label('My awesome label')->textInput([
'class' => 'form-control test',
'style' => 'background: red'
]);
Greetings,
I've found a possible bug in your ActiveField and the way it handles the inputOptions, class in specific.
Some example code to help you reproduce the bug:
Will result in different view files depending on what type of activeForm is used.
As you can see it is only using the default form-control but not adding the test class! However it did add the background color of red.
Default ActiveForm does however add the test class.
Hope you can tell me what is wrong, what I am doing wrong of how to fix this. Thanks in advance for all your great libraries!