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

'autoPlaceholder' overwrites explicit placeholder setting with model default #61

Closed derekisbusy closed 9 years ago

derekisbusy commented 9 years ago

When setting the placeholder value with 'autoPlaceholder' set to true the placeholder value is overwritten by $model->getAttributeLabel(). Should use getAttributeLabel() as default instead.

// when autoPlaceholder set to true...
$this->formOptions['fieldConfig'] = ['autoPlaceholder' => true];

'phone' => [
    'type'=> Form::INPUT_TEXT,
    'options'=>[
        // overwrites placeholder value...
        'placeholder'=>Yii::t('common','Enter Phone...'),
        'class'=>'form-control'
    ],
]