yii - >小部件" TbActiveForm" - >删除(重命名)占位符

时间:2015-10-19 11:53:31

标签: yii

如何从(in)文本输入字段中删除(重命名)占位符,而不是更改" attributeLabels()"在模特?

$form = $this->beginWidget('booster.widgets.TbActiveForm', array(
        'id' => 'email-recovery-form',
        'enableAjaxValidation' => true,
        'clientOptions' => array(
            'validateOnSubmit' => true,
            'validateOnChange' => false,
        ),
        'type' => 'inline',
    ));
    ?>

    <div class="label-input" id="rec-button"><?=Yii::t('app', 'Email');?></div>
    <?=$form->textFieldGroup($model, 'email');?>
    <br/>
    <input class="yBtn" type="submit" value="<?=Yii::t('app', 'Do action');?>">

    <?php $this->endWidget(); ?>

我试过

<?=$form->textFieldGroup($model, 'email', array('placeholder'=>'Username'));?>

但它确实无法运作

1 个答案:

答案 0 :(得分:0)

如果我理解了你想要的是以下内容:

echo $form->textFieldGroup($model, 'email', array('hint'=>'Username'));