twitter bootstrap - How to disable wrap checkbox with .form-group in Yii2 -
how disable wrap checkbox div.form-group in yii2 using yii\bootstrap\activeform?
that need (adminlte login page template):
<div class="row"> <div class="col-xs-8"> <div class="checkbox icheck"> <label> <input type="checkbox"> remember me </label> </div> </div> <div class="col-xs-4"> <button type="submit" class="btn btn-primary btn-block btn-flat">sign in</button> </div> </div>
i tried:
<?php $form = activeform::begin(['id' => 'login-form']); ?> ... <div class="row"> <div class="col-xs-8"> <?= $form->field($model, 'rememberme')->checkbox(); ?> </div> <div class="col-xs-4"> <?= html::submitbutton('sign in', ['class' => 'btn btn-primary btn-block btn-flat', 'name' => 'login-button']); ?> </div> </div> <?php activeform::end(); ?>
it render to:
<div class="row"> <div class="col-xs-8"> <div class="form-group field-loginform-rememberme"> <div class="checkbox"> <label> <input type="checkbox" name="loginform[rememberme]" value="0"> remember me </label> <p class="help-block help-block-error"></p> </div> </div> </div> <div class="col-xs-4"> <button type="submit" class="btn btn-primary btn-block btn-flat">sign in</button> </div> </div>
everything except wrapper <div class="form-group field-loginform-rememberme">
how remove wrapper?
$form->field($model,'field',[ 'options'=> [ 'tag'=>'div', 'class'=>'checkbox icheck' ] ] )->checkbox();
or can in next way
$field = $form->field($model,'field',[ 'options'=> [ 'tag'=>'div', 'class'=>'checkbox icheck' ], 'selectors'=>[ 'error'=>'span.error' ] ] ); echo $field->begin(); ?> <label><?php echo \yii\helpers\html::activecheckbox($model,'field'); ?></label> <?php echo \yii\helpers\html::error($model,'field', ['class'=>'error','tag'=>'span' ]); <?php echo $field->end();
something this.
Comments
Post a Comment