<?php echo $el->getInput(); ?> </div> </div> <?php } else { ?> <div class="form-group<?php if (!empty($errors)) { echo ' has-error'; } ?> "> <label for="<?php echo Html::clearAttribute($el->getAttribute('id')); ?> " class="col-sm-3 control-label"> <?php echo Html::clearText($el->getLabel()); ?> </label> <div class="col-sm-9"> <?php echo $el->addToAttribute('class', ' form-control')->getInput(); ?> <?php if (!empty($errors)) { ?> <span class="help-block"><?php echo implode(', ', $errors);
/** * @dataProvider clearTextProvider */ public function testClearAttribute($string, $expected) { $res = \serviform\helpers\Html::clearAttribute($string); $this->assertEquals($expected, $res); }