How is it possible in the options for the $form->field to add a div or class to the form input so I can have an inline label as opposed to a label above the input.
You can play with the template property of ActiveField to do this.
OR if you want you can directly use one of these extensions:
ActiveForm in yii2-widgets. Just set the autoPlaceholder to true, this will convert all labels to inline placeholders (works for text inputs and text areas). You can also control bootstrap form layouts in here.
use kartik\widgets\ActiveForm;
$form = kartik\widgets\ActiveForm::begin([
'fieldConfig' => ['autoPlaceholder'=>true]
]);
yii2-label-inplace - sets the labels to inline that pushes up or down once you enter the field
For Yii 1.1 I had to extend the form class and add a method to render a label, error and input with container divs etc as this is not natively supported there. I’ve also extended the methods for each form field type to set aria-* for better screen reader support. For example set attributes to tell screen readers to watch the error divs for content inserted via JS. I will start to port this over to 2.0. Eg. extending ActiveForm may be a solution if there are not config options available for your desired solution. Or in 2.0 the new Field thingy might be a class that you can extend and leave ActiveForm untouched.