Skip to content

Latest commit

History

History
23 lines (17 loc) 路 576 Bytes

custom_form_types.md

File metadata and controls

23 lines (17 loc) 路 576 Bytes

Custom Form Types

This bundle provide the following custom form types:

SwitchType

The SwitchType type has the same behavior as the CheckboxType type and allows to display a checkbox as a toggle switch:

namespace App\Form;

use TalesFromADev\FlowbiteBundle\Form\Type\SwitchType

class TemplateType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $builder
            ->add('switch', SwitchType::class)
        ;
    }
}