|
| 1 | +<?php |
| 2 | + |
| 3 | +/* |
| 4 | + * This file is part of Monsieur Biz' Rich Editor plugin for Sylius. |
| 5 | + * |
| 6 | + * (c) Monsieur Biz <[email protected]> |
| 7 | + * |
| 8 | + * For the full copyright and license information, please view the LICENSE.txt |
| 9 | + * file that was distributed with this source code. |
| 10 | + */ |
| 11 | + |
| 12 | +declare(strict_types=1); |
| 13 | + |
| 14 | +namespace MonsieurBiz\SyliusRichEditorPlugin\Form\Type; |
| 15 | + |
| 16 | +use Symfony\Component\Form\Extension\Core\Type\ChoiceType; |
| 17 | +use Symfony\Component\OptionsResolver\OptionsResolver; |
| 18 | + |
| 19 | +class TextSizeType extends ChoiceType |
| 20 | +{ |
| 21 | + public const SIZE_XS = 'xs'; |
| 22 | + |
| 23 | + public const SIZE_S = 's'; |
| 24 | + |
| 25 | + public const SIZE_M = 'm'; |
| 26 | + |
| 27 | + public const SIZE_L = 'l'; |
| 28 | + |
| 29 | + public const SIZE_XL = 'xl'; |
| 30 | + |
| 31 | + public const SIZE_XXL = 'xxl'; |
| 32 | + |
| 33 | + public function configureOptions(OptionsResolver $resolver): void |
| 34 | + { |
| 35 | + parent::configureOptions($resolver); |
| 36 | + $resolver->setDefaults([ |
| 37 | + 'label' => 'monsieurbiz_richeditor_plugin.form.text_size.label', |
| 38 | + 'help' => 'monsieurbiz_richeditor_plugin.form.text_size.label_help', |
| 39 | + 'choices' => [ |
| 40 | + 'monsieurbiz_richeditor_plugin.form.text_size.default' => '', |
| 41 | + 'monsieurbiz_richeditor_plugin.form.text_size.xs' => self::SIZE_XS, |
| 42 | + 'monsieurbiz_richeditor_plugin.form.text_size.s' => self::SIZE_S, |
| 43 | + 'monsieurbiz_richeditor_plugin.form.text_size.m' => self::SIZE_M, |
| 44 | + 'monsieurbiz_richeditor_plugin.form.text_size.l' => self::SIZE_L, |
| 45 | + 'monsieurbiz_richeditor_plugin.form.text_size.xl' => self::SIZE_XL, |
| 46 | + 'monsieurbiz_richeditor_plugin.form.text_size.xxl' => self::SIZE_XXL, |
| 47 | + ], |
| 48 | + ]); |
| 49 | + } |
| 50 | +} |
0 commit comments