various improvements on 3party

This commit is contained in:
2021-10-07 17:28:33 +02:00
parent 7ea2c36c5e
commit ca3ced0308
20 changed files with 464 additions and 305 deletions

View File

@@ -24,14 +24,14 @@ use Symfony\Component\Form\FormInterface;
/**
* Available options :
*
*
* - `button_add_label`
* - `button_remove_label`
* - `identifier`: an identifier to identify the kind of collecton. Useful if some
* javascript should be launched associated to `add_entry`, `remove_entry` events.
*
* - `empty_collection_explain`
*
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
*/
class ChillCollectionType extends AbstractType
{
@@ -41,10 +41,11 @@ class ChillCollectionType extends AbstractType
->setDefaults([
'button_add_label' => 'Add an entry',
'button_remove_label' => 'Remove entry',
'identifier' => ''
'identifier' => '',
'empty_collection_explain' => '',
]);
}
public function buildView(FormView $view, FormInterface $form, array $options)
{
$view->vars['button_add_label'] = $options['button_add_label'];
@@ -52,8 +53,9 @@ class ChillCollectionType extends AbstractType
$view->vars['allow_delete'] = (int) $options['allow_delete'];
$view->vars['allow_add'] = (int) $options['allow_add'];
$view->vars['identifier'] = $options['identifier'];
$view->vars['empty_collection_explain'] = $options['empty_collection_explain'];
}
public function getParent()
{
return \Symfony\Component\Form\Extension\Core\Type\CollectionType::class;