In Yii2 how to do insert in 2nd table relations?

There is a table tab1 and tab2, I can not find an example of maintaining a data link with fk, how to save such data?

UPD: Preferably using transactions.
July 9th 19 at 13:59
1 answer
July 9th 19 at 14:01

Find more questions by tags Yii