I’m getting an error which says “Class ‘app\models\LoginForm’ not found” in SiteController.php
Model’s function which I’m getting the error
public function actionLogin()
{
if (!Yii::$app->user->isGuest) {
return $this->goHome();
}
$model = new LoginForm();
if ($model->load(Yii::$app->request->post()) && $model->login()) {
return $this->goBack();
}
return $this->render('login', [
'model' => $model,
]);
}
In this line:
$model = new LoginForm();
I don’t know what happened since I didn’t changed any code in SiteController I still have this:
use Yii;
use yii\filters\AccessControl;
use yii\web\Controller;
use yii\web\Response;
use yii\filters\VerbFilter;
use app\models\LoginForm;
use app\models\ContactForm;