Search code examples
yiiyii-extensionsyii-booster

How do I set customized placeholder in 'booster.widgets.TbActiveForm'?


I use like this..

<div class="row">
    <?php echo $form->textFieldGroup(
    $User,'email_address',
       array(
         'wrapperHtmlOptions' => array(
           'class'=> 'col-sm-5',

         ),

        )   
        );
    ?>
</div> 

But there is default placeholder 'Email Address'. How I want to set there my own placeholder ?


Solution

  • you can add html options as below:

    <?php echo $form->textFieldGroup(
        $User,'email_address',
        array(
            'wrapperHtmlOptions' => array(
                'class'=> 'col-sm-5',
    
            ),
            'widgetOptions' => array(
                'htmlOptions' => array(
                    'placeholder' => 'my placeholder'
                )
            )
    
        )
    );
    ?>
    

    for more detail have a look at Booster active form