bukashk0zzz/booleantype-bundle

A simple Symfony bundle that adds boolean form field type.

Installs: 39 336

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 3

Forks: 0

Type:symfony-bundle

v2.1.0 2021-12-10 08:44 UTC

This package is auto-updated.

Last update: 2024-04-10 13:56:08 UTC


README

Build Status Code Coverage Scrutinizer Code Quality License Latest Stable Version Total Downloads

About

A simple Symfony bundle that adds boolean form field type.

Installation Symfony Flex

composer config extra.symfony.allow-contrib true
composer require bukashk0zzz/booleantype-bundle

Installation without Symfony Flex

composer require bukashk0zzz/booleantype-bundle

Add the bundle to app/AppKernel.php

$bundles = array(
	// ... other bundles
	new Bukashk0zzz\BooleanTypeBundle\Bukashk0zzzBooleanTypeBundle(),
);

Configuration

Not needed.

Usage

Inside a FormType:

class AccountProfileType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('nameFirst', TextType::class, ['label' => 'First Name'])
            ->add('nameLast', TextType::class, ['label' => 'Last Name'])
            ->add('active', BooleanType::class, [
                'label' => 'User active?',
                'required' => false,
            ])
        ;
    }
}

Copyright / License

See LICENSE