2017 © Pedro Peláez
 

symfony-bundle form-js-validation-bundle

Symfony Form Js Validation Bundle

image

acseo/form-js-validation-bundle

Symfony Form Js Validation Bundle

  • Tuesday, December 12, 2017
  • by npotier
  • Repository
  • 4 Watchers
  • 1 Stars
  • 3,359 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 4 Open issues
  • 11 Versions
  • 71 % Grown

The README.md

ACSEO Form JS Validation Bundle

A bundle that add js validation to you forms, (*1)

Installation

1) Install using composer, (*2)

composer require acseo/form-js-validation-bundle

2) Update AppKernel.php :, (*3)

<?php
// app/AppKernel.php
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
        // ...
        new ACSEO\Bundle\FormJsValidationBundle\ACSEOFormJsValidationBundle(),
        // ...

3) Select your js validation plugin between validation.io and jqueryvalidation.org in the parameters.yml :, (*4)

// app/config/parameters.yml

parameters:
    // ...
    // to use the validation.io
    acseo_form_js_validation.service: acseo_form_js_validation_io
    // or to use the jqueryvalidation.org
    acseo_form_js_validation.service: acseo_form_jquery_form_validator

Usage

Add Form validation to your form

In your controller, add js form validation :, (*5)

<?php
//...
public function newAction(Request $request)
{
    // ...
    $awesomeEntity = new AwesomeEntity();
    $form   = $this->createForm(AwesomeEntityType::class, $awesomeEntity,array(
        'action' => $this->generateUrl('awesomeentity_new'),
        'method' => 'POST')
    );

    // ...
    $form = $this->get("acseo_form_js_validation.service")->addJsValidation($form);
    // ...

Update templates

Using form validation.io

1) In your base template, use formvalidation js and css : http://formvalidation.io/getting-started/#usage, (*6)

2) In the template when the form is used, just update the code with this :, (*7)



{{ form_start(form, {'attr': { 'id' : 'awesome_entity_form', 'data-fv-framework' : 'bootstrap', }}) }}



{{ form_end(form)}}






Using form jqueryvalidation.org

1) In your base template, use jqueryvalidation js and css : https://github.com/jquery-validation/jquery-validation/releases, (*8)

2) In the template when the form is used, just update the code with this :, (*9)



{{ form_start(form, {'attr': {'id': 'awesome_entity_form'}}) }}



{{ form_end(form)}}






The Versions

12/12 2017

dev-npotier-patch-2

dev-npotier-patch-2 https://github.com/acseo/FormJsValidationBundle

Symfony Form Js Validation Bundle

  Sources   Download

The Requires

 

by Nicolas Potier

form validation javascript symfony

12/12 2017

dev-npotier-patch-1

dev-npotier-patch-1 https://github.com/acseo/FormJsValidationBundle

Symfony Form Js Validation Bundle

  Sources   Download

The Requires

 

by Nicolas Potier

form validation javascript symfony

26/10 2017

dev-master

9999999-dev https://github.com/acseo/FormJsValidationBundle

Symfony Form Js Validation Bundle

  Sources   Download

The Requires

 

by Nicolas Potier

form validation javascript symfony

26/10 2017

v1.2.0

1.2.0.0 https://github.com/acseo/FormJsValidationBundle

Symfony Form Js Validation Bundle

  Sources   Download

The Requires

 

by Nicolas Potier

form validation javascript symfony

26/10 2017

v1.0.x-dev

1.0.9999999.9999999-dev https://github.com/acseo/FormJsValidationBundle

Symfony Form Js Validation Bundle

  Sources   Download

The Requires

 

by Nicolas Potier

form validation javascript symfony

21/09 2017

v1.1.1

1.1.1.0 https://github.com/acseo/FormJsValidationBundle

Symfony Form Js Validation Bundle

  Sources   Download

The Requires

 

by Nicolas Potier

form validation javascript symfony

21/09 2017

v1.1.0

1.1.0.0 https://github.com/acseo/FormJsValidationBundle

Symfony Form Js Validation Bundle

  Sources   Download

The Requires

 

by Nicolas Potier

form validation javascript symfony

19/09 2017

v1.0.0

1.0.0.0 https://github.com/acseo/FormJsValidationBundle

Symfony Form Js Validation Bundle

  Sources   Download

The Requires

 

by Nicolas Potier

form validation javascript symfony

23/06 2017

v0.0.3

0.0.3.0 https://github.com/acseo/FormJsValidationBundle

Symfony Form Js Validation Bundle

  Sources   Download

The Requires

 

by Nicolas Potier

form validation javascript symfony

23/06 2017

v0.0.2

0.0.2.0 https://github.com/acseo/FormJsValidationBundle

Symfony Form Js Validation Bundle

  Sources   Download

The Requires

 

by Nicolas Potier

form validation javascript symfony

23/06 2017

v0.0.1

0.0.1.0 https://github.com/acseo/FormJsValidationBundle

Symfony Form Js Validation Bundle

  Sources   Download

The Requires

 

by Nicolas Potier

form validation javascript symfony