mootensai / yii2-relation-trait

Yii 2 Models add functionality for load with relation, & transactional save with relation PLUS soft delete/restore feature
47 stars 45 forks source link

Yii2-dynamic forms - Nested Dynamic Form #23

Open jonatasfl opened 8 years ago

jonatasfl commented 8 years ago

Firstly thank you for this extension and sorry for my bad english!

I'm using this extension with Yii2-dynamicforms and it works perfecly on simple scenario, avoiding unnecessary code.

Now I'm trying to use with Nested Dynamic Form example and i'm getting this error:

error_relation

This occurs when I create a relation via a junction table in Person model.

public function getHouses()
{
     return $this->hasMany(House::className(), ['person_id' => 'id']);
}
public function getRooms()
{
     return $this->hasMany(Room::className(), ['id' => 'person_id'])->via('houses');
}

Is there any solution to this problem or the extension does not support it?

Thank you!

mootensai commented 8 years ago

Could you send me your schema?

mootensai commented 8 years ago

Alternative : you could use https://github.com/mootensai/yii2-enhanced-gii

jonatasfl commented 8 years ago

@mootensai I'm using this example

db-demo3

nested

If your extension to work with nested forms (usually it works with simple dynamic forms), will save many lines of code

Thank you for your attention and sorry for my bad english!

deadmantfa commented 8 years ago

Any update on this?? I trying something similar but its not working

mootensai commented 8 years ago

not yet..currently busy..could someone help?

mootensai commented 7 years ago

please try again with the new version