According to the official tutorial of Yii2. I have created a view for the entry form:
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
?>
<?php $form = ActiveForm::begin(); ?>
<!-- GET Attention for the next Line -->
<?= $form->field($model, 'name')->label('Your Name'); ?>
<?= $form->field($model, 'email'); ?>
<div class="form-group">
<?= Html::submitButton('Send!', ['class' => 'btn btn-primary']); ?>
</div>
<?php ActiveForm::end(); ?>
At this point everything is well fine. However, when I try to use the parameter options of the field method as follows:
<?= $form->field($model, 'name', ['style' => 'color:red'])->label('Your Name'); ?>
I have got the error:
Unknown Property – yii\base\UnknownPropertyException
Setting unknown property: yii\widgets\ActiveField::style
The official api documentation stated that method of ActiveForm takes a third parameter called options
Could anybody explain me why this error has been occurred?!