0

I have the following database design, represented in the diagram,:

enter image description here

As the diagram demonstrates, Invoices model has one to many relation with InvoiceItems model. However, when I use Gii to produce CRUD it generates inovieces/view without any related data from invoice-items table (InvoiceItems model).

During Model generation, I have checked Generate Relations. So, I ask for more better Code Generation plugin for Yii2 that able to make relations available in the CRUD.

SaidbakR
  • 13,303
  • 20
  • 101
  • 195
  • 1
    I'm not sure if there are other yii2 code generators out there, but I think gii is enough. For the related data that you are asking for, this is the part where you will be the one to code it yourself. Looking at your database, I assume that you are looking for a dropdown containing `InvoiceItems` for your `Invoice`. ArrayHelper ([docs](http://www.yiiframework.com/doc-2.0/yii-helpers-arrayhelper.html) [guide](http://www.yiiframework.com/doc-2.0/guide-helper-array.html)) might be of help. Take a look at [this](http://stackoverflow.com/a/21569713/2431281). – Keale Jan 19 '16 at 01:48
  • Why don't you try to code by hand? Anything that Gii creates is the code, that can be written by anyone. Still, your database structure seems not normalized. – Deele Jan 20 '16 at 00:06

0 Answers0