I have the following error
Class 'app\controllers\ActiveForm' not found
when submit the following ActiveForm
(kartik\widgets\ActiveForm)
$form = ActiveForm::begin([
'type'=>ActiveForm::TYPE_VERTICAL,
'action' => 'incarico/update/'.$model->id,
'enableAjaxValidation' => true,
'enableClientValidation' => false,
]);
My controller has this action:
public function actionUpdate($id)
{
$model = $this->findModel($id);
if (Yii::$app->request->isAjax && $model->load(Yii::$app->request->post())) {
Yii::$app->response->format = Response::FORMAT_JSON;
return ActiveForm::validate($model);
} else {
return $this->render('update', [
'model' => $model,
]);
}
}
The error refers to this line
return ActiveForm::validate($model);