/** * {@inheritdoc} */ public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('name'); $builder->add('rate', PercentType::class, ['precision' => 2]); $types = Tax::getTypes(); array_walk($types, function (&$value) { $value = ucwords($value); }); $builder->add('type', Select2::class, ['choices' => $types, 'help' => 'tax.rates.explanation', 'placeholder' => 'tax.rates.type.select']); }
/** * {@inheritdoc} */ public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('name'); $builder->add('rate', 'percent', array('precision' => 2)); $types = Tax::getTypes(); array_walk($types, function (&$value) { $value = ucwords($value); }); $builder->add('type', 'select2', array('choices' => $types, 'choices_as_values' => false, 'help' => 'tax.rates.explanation', 'placeholder' => 'tax.rates.type.select')); }