| 1: | <?php |
| 2: | namespace TIC\FormBundle\Form\Type; |
| 3: | |
| 4: | |
| 5: | use TIC\FormBundle\Base\TICWidgetType as BaseType; |
| 6: | |
| 7: | use Symfony\Component\OptionsResolver\OptionsResolver; |
| 8: | |
| 9: | |
| 10: | |
| 11: | |
| 12: | class NumberMoneyType extends BaseType |
| 13: | { |
| 14: | protected $form_parent = NumberType::class; |
| 15: | protected $default_suffix = '€'; |
| 16: | |
| 17: | |
| 18: | |
| 19: | |
| 20: | |
| 21: | public function configureOptions(OptionsResolver $resolver): void |
| 22: | { |
| 23: | parent::configureOptions($resolver); |
| 24: | |
| 25: | $resolver->setDefaults(array( |
| 26: | 'suffix' => true, |
| 27: | 'scale' => 2, |
| 28: | 'grouping' => true, |
| 29: | 'rounding_mode' => \NumberFormatter::ROUND_HALFUP, |
| 30: | 'min' => 0, |
| 31: | 'fixed' => true, |
| 32: | 'mode' => 'js', |
| 33: | )); |
| 34: | } |
| 35: | |
| 36: | |
| 37: | } |
| 38: | |