mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
various improvements on 3party
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user