0
votes
<?php
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;


$form = ActiveForm::begin(['id' => 'login-form']);

ActiveForm::end(); 
?>

If i run this code the following error will occur.

Fatal error: Class 'yii\bootstrap\ActiveForm' not found in E:\wamp\www\yii2-paypal-master\backend\views\site\login.php on line 6

Kindly help me to fix this.

Thanks

1

1 Answers

2
votes

Replace

use yii\bootstrap\ActiveForm;

with

use yii\widgets\ActiveForm;

Form:

   <?php $form = ActiveForm::begin([
            'options'=>['enctype'=>'multipart/form-data'],
    ]);
    ?>

    <?= $form->errorSummary($model) ?>

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

  <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

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