In Yii2 how to create records in the database?

In YII2 after the user has registered, to create in another table, 10 entries?
here is a script user registration
<?php
/**
 * Created by PhpStorm.
 * User: User
 * Date: 23.04.2018
 * Time: 19:31
*/

namespace app\models;


use Yii;
use yii\base\Model;

class Signup extends Model
{public $username;
 public $email;
 public $password;
 public function rules()
{
return[
[['email','username','password'],'required'],
 ['email', 'email'],
['password','string','min'=-->2,'max'=>30]
];
}
 public function signup()
{
 $developer=new developer();
$developer->username=$this->username;
$developer->email=$this->email;
$developer->password=Yii::$app->getSecurity()->generatePasswordHash($this->password);
 return $developer->save();


}
}

here is the field for the 2 tables
$model = new Product;
$model->category_id='2';
$model->author_id=$app->user->identity['id'];
$model->name='name';
$model->content='content';
$model->price='0';
$model->keywords='NULL';
$model->description='NULL';
$model->hit='0';
$model->new='0';
 $model->save();
June 5th 19 at 21:43
2 answers
June 5th 19 at 21:45
Dig in the side events.
June 5th 19 at 21:47
If the event is difficult although this is a more correct solution, it is possible to model Developers to override the afterSave method.

Find more questions by tags Yii