Form Types

To be updated soon.

The bundle provides 5 Form Types:

File Type

Image Type

Recaptcha Type

This Form Type is based on the EWZRecaptchaBundle, and allow you to generate a Recaptcha in your form, and validate it.

Usage

use Leapt\CoreBundle\Form\Type\RecaptchaType;
use Leapt\CoreBundle\Validator\Constraints as LeaptCore;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;

final class ContactType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('recaptcha', RecaptchaType::class, [
            'label' => false,
            'constraints' => new LeaptCore\Recaptcha(),
        ]);
    }
}

Layout

Use/extend the @LeaptCore/Form/form_core_layout.html.twig, or add it to your Twig’s form_themes configuration so the field is rendered properly.

Configuration

# config/packages/leapt_core.yaml
leapt_core:
    recaptcha:
        public_key:  'your_public_key'
        private_key: 'your_private_key'
        enabled: true # true by default, but you can set it to false for your tests

Sound Type

Video Type


Installation

Paginator