Using ActiveForm without bootstrap template in Yii2


 

<?php $form = ActiveForm::begin(); ?>


<?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>


<?php ActiveForm::end(); ?>



How can I get the input text box without bootstrap 3 wrapper codes ? I am using a custom HTML wrapper and how can I implement my own template for the text box ?

thanks

You can separate them and put your own html around them


<?= Html::activeLabel($user, 'title'); ?>

<?= Html::activeTextInput($user, 'title'); ?>

<?= Html::error($user, 'title'); ?>

or configure the activeform to your format


$form = ActiveForm::begin([

    'layout' => 'horizontal',

    'fieldConfig' => [

        'template' => "{label}\n{beginWrapper}\n{input}\n{hint}\n{error}\n{endWrapper}",

        'horizontalCssClasses' => [

            'label' => 'col-sm-4',

            'offset' => 'col-sm-offset-4',

            'wrapper' => 'col-sm-8',

            'error' => '',

            'hint' => ''

        ]

    ]]);