Any way to get de id or the name of the father in a child form field?

Hi, i'm building a custom field, and I want to know if i have any way to get fathers name or id in my custom field. I need it dynamic, for example, if it have 2 fathers or 3, i need to get all id. For example if I have this form structure:
Section::make(...)
->schema([
Section::make(...)
->schema([
MyCustomField::make(...)
])
])
Section::make(...)
->schema([
Section::make(...)
->schema([
MyCustomField::make(...)
])
])
It is possible to do that? Note: I can't pass it as param of make, i need other way. Thanks for your time.
2 Replies
Dan Harrin
Dan Harrin2y ago
->getContainer()->getParentComponent() will get the parent component and you can call that repeatedly until there is no parent component
jals65
jals65OP2y ago
ok, thank you
Want results from more Discord servers?
Add your server