amaxlab/form-bundle

There is no license information available for the latest version (dev-master) of this package.

Provides some useful form types

Installs: 24

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 3

Forks: 0

Open Issues: 0

Type:symfony-bundle

dev-master / 1.0.x-dev 2015-10-13 16:20 UTC

This package is not auto-updated.

Last update: 2024-12-25 12:20:59 UTC


README

AmaxlabFormBundle provides some useful form types for Symfony2 framework

Install

0. Add to composer.json

composer require amaxlab/form-bundle

1. Add bundle to AppKernel.php

$bundles = array(
    ...
    new Amaxlab\Bundle\FormBundle\AmaxlabFormBundle(),
);

2. Configure

Create new recaptcha for you domain in https://www.google.com/recaptcha/intro/index.html

Add this keys to config.yml:

amaxlab_form:
    recaptcha2:
        public_key: 6LfaoQ4TAAAAAOdnLoFZIjBayGa5zUyUOOeNe3y4
        private_key: 6LfaoQ4TAAAAAJvOlPjYNgLUJMfNWllKR7zfiJb7

Form Types

1. select_or_add

Allow select from entity from standart select or add a new Entity throw attached form

2. amaxlab_recaptcha2

Add to you form new field (probably not mapped to entity)

$form
    ->add('recaptcha', 'amaxlab_recaptcha2', array(
        'mapped' => false,
    ));

Now form will not passed validation if recaptcha is invalid.