Skip to content

Commit

Permalink
add collectionListCssClass option
Browse files Browse the repository at this point in the history
  • Loading branch information
kossitk authored Nov 27, 2018
1 parent ea34e12 commit 193714b
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions Form/Extension/CollectionTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ public function getExtendedType()
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'column_header_label' => true,
'single_field_label' => false,
'single_field_label_xs' => true,
'entry_css_class' => 'row',
'entry_actions_css_class' => 'text-right',
'column_css_class' => array(),
'column_header_label' => true,
'single_field_label' => false,
'collection_list_css_class' => '',
'single_field_label_xs' => true,
'entry_css_class' => 'row',
'entry_actions_css_class' => 'text-right',
'column_css_class' => array(),
));

// Optional
Expand All @@ -48,6 +49,7 @@ public function configureOptions(OptionsResolver $resolver)
$resolver->setAllowedTypes('column_header_label', 'bool');
$resolver->setAllowedTypes('single_field_label', 'bool');
$resolver->setAllowedTypes('single_field_label_xs', 'bool');
$resolver->setAllowedTypes('collection_list_css_class', 'string');
$resolver->setAllowedTypes('entry_css_class', 'string');
$resolver->setAllowedTypes('entry_actions_css_class', 'string');
$resolver->setAllowedTypes('column_css_class', 'array');
Expand Down Expand Up @@ -88,12 +90,13 @@ public function buildView(FormView $view, FormInterface $form, array $options)
}

// values sended to form view
$view->vars['entryActionsCssClass'] = $entryActionsCssClass;
$view->vars['columnCssClass'] = $columnCssClass;
$view->vars['columnHeaderLabel'] = $options['column_header_label'];
$view->vars['singleFieldLabel'] = $options['single_field_label'];
$view->vars['singleFieldLabelXs'] = $options['single_field_label_xs'];
$view->vars['entryCssClass'] = $options['entry_css_class'];
$view->vars['entryActionsCssClass'] = $entryActionsCssClass;
$view->vars['columnCssClass'] = $columnCssClass;
$view->vars['collectionListCssClass'] = $options['collection_list_css_class'];
$view->vars['columnHeaderLabel'] = $options['column_header_label'];
$view->vars['singleFieldLabel'] = $options['single_field_label'];
$view->vars['singleFieldLabelXs'] = $options['single_field_label_xs'];
$view->vars['entryCssClass'] = $options['entry_css_class'];
}

}

0 comments on commit 193714b

Please sign in to comment.