In yii I had such code which was roking OK
$form=$this->beginWidget('CActiveForm', array(
'id'=>'ride-form',
'enableClientValidation'=>false,
'clientOptions'=>array(
'validateOnSubmit'=>true,
),
));
now I am trying to use it in Yii 2 version. But I'm getting error
Calling unknown method: yii\web\View::beginWidget()
Why ? and what class maybe I should additionally use to fix this problem ?
This error appears because
yii\web\View
class simply does not have the methodbeginWidget()
.For working with forms in Yii2 use ActiveForm widget.
Replace your code with: