activeEmailFieldControlGroup() public static method

Generates a control group with a email field for a model attribute.
See also: self::activeControlGroup
public static activeEmailFieldControlGroup ( CModel $model, string $attribute, array $htmlOptions = [] ) : string
$model CModel the data model.
$attribute string the attribute.
$htmlOptions array additional HTML attributes.
return string the generated control group.
Example #1
0
 public function testActiveEmailFieldControlGroup()
 {
     $I = $this->codeGuy;
     $html = TbHtml::activeEmailFieldControlGroup(new Dummy(), 'email');
     $group = $I->createNode($html, 'div.control-group');
     $label = $group->filter('label.control-label');
     $I->seeNodeChildren($label, array('input[type=email]'));
 }
}
?>

        <form method="post" class="form-horizontal">

            <?php 
echo TbHtml::activeTextFieldControlGroup($model, 'username');
?>
            <?php 
echo TbHtml::activePasswordFieldControlGroup($model, 'password');
?>
            <?php 
echo TbHtml::activePasswordFieldControlGroup($model, 'password_verify');
?>
            <?php 
echo TbHtml::activeEmailFieldControlGroup($model, 'email');
?>

            <!--
                <div class="span3 control-group">

                    <div class="controls">
                        <?php 
//echo CHtml::textField('Users[username]', $model->username, array('maxlength' => 255, 'id' => 'Users_username'));
?>
                        <?php 
echo CHtml::activeTextField($model, 'username');
?>
                    </div>
                </div>
 /**
  * Generates a control group with an email field for a model attribute.
  * @param CModel $model the data model.
  * @param string $attribute the attribute name.
  * @param array $htmlOptions additional HTML attributes.
  * @return string the generated row.
  * @see TbHtml::activeEmailFieldControlGroup
  */
 public function emailFieldControlGroup($model, $attribute, $htmlOptions = array())
 {
     $htmlOptions = $this->processRowOptions($model, $attribute, $htmlOptions);
     return TbHtml::activeEmailFieldControlGroup($model, $attribute, $htmlOptions);
 }