The Yii2 documentation tells you that when working with forms you need to inherit from the Model class .
<?php namespace app\models; use yii\base\Model; class EntryForm extends Model { public $name; public $email; public function rules() { return [ [['name', 'email'], 'required'], ['email', 'email'], ]; } } validation rules are set up here
The question is , if this data is valid, how will it be correctly recorded in the database? Do I need to change the inheritance from model to ActiveRecord? Or am I confusing something? The config for working with the database is already configured. Only without Gii please.