yii2多步形式

yii2多步形式,yii2,yii2-advanced-app,Yii2,Yii2 Advanced App,我刚刚习惯了yii2 Am creating a multistep form in yii2 which involves three related tables 桌子 User table:has (idno(primary key), firstname, secondname and lastname) Education table has: (idno(foreign key), institution_name, year_completed, grade)

我刚刚习惯了yii2

Am creating a multistep form in yii2 which involves three related tables
桌子

User table:has         (idno(primary key), firstname, secondname and lastname)
Education table has:  (idno(foreign key), institution_name, year_completed, grade)
Contacts table has:   (idno(f.key),contact)
模型和关系

用户与联系人的关系

 public function getContacs()
{
    return $this->hasMany(Contacts::className(), ['idno' => 'idno']);
}
 public function getUser()
{
    return $this->hasOne(User::className(), ['idno' => 'idno']);
}
btwn用户与教育的关系

public function getEducation()
{
    return $this->hasMany(Education::className(), ['idno' => 'idno']);
}

public function getUser()
{
    return $this->hasOne(User::className(), ['idno' => 'idno']);
}

如何创建一个多步骤表单,用户在第一步中填写关于教育详细信息下一步的his详细信息表单自动选择用户ID并将其传递给教育详细信息,直到完成。您需要为每个步骤维护一个标志,例如,第一步=0,第二步=0,第三步=0。如果填写了第一步,则更改第一步=1对其他步骤执行相同操作,此字段应出现在用户表中,或者您可以使用用户id作为外键维护另一个表。如果first_step=1,则当您再次登录并打开页面时,其中flag=0表示将直接打开第二步。这是一个基本的概念,所以你可以得到的想法,还有其他的方法

我将如何设置控制器。您有现有的示例吗