Closed ELtd closed 2 weeks ago
Hello,
I use a specific form in two collections. I don't want to have the same labels in the two. We should be able to force the language name in the options of the collection.
Form A [ Collection A1 [ Form B ], Collection A2[ Form B ] ]
To fix the problem :
https://github.com/kristijanhusak/laravel-form-builder/blob/ee4f8f1c41593f8f747e98b96355ba57f13a3be8/src/Kris/LaravelFormBuilder/Fields/ChildFormType.php#L119
- 'language_name' => $this->parent->getLanguageName(), + 'language_name' => $this->getOption('language_name') ?: $this->parent->getLanguageName(),
Then this code works as expected :
$this->add('A1', 'collection', [ 'type' => 'form', 'options' => [ 'class' => B::class, 'language_name'=>'models.A1.B', ] ]);
Thank you for your package !
Looks good. PR please.
I never use the 'language name' - I always explicitly set label for every field - so I can't test it, but it looks safe enough.
label
Fixed in #729
Hello,
I use a specific form in two collections. I don't want to have the same labels in the two. We should be able to force the language name in the options of the collection.
To fix the problem :
https://github.com/kristijanhusak/laravel-form-builder/blob/ee4f8f1c41593f8f747e98b96355ba57f13a3be8/src/Kris/LaravelFormBuilder/Fields/ChildFormType.php#L119
Then this code works as expected :
Thank you for your package !