2017 © Pedro PelĂĄez
 

symfony-bundle parsley-server-bundle

Allow to get Symfony 2 form server-side validation on a field type

image

mysportconnect/parsley-server-bundle

Allow to get Symfony 2 form server-side validation on a field type

  • Wednesday, January 8, 2014
  • by comensee
  • Repository
  • 3 Watchers
  • 8 Stars
  • 251 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

ParlseyjsServerBundle

A symfony 2 bundle integration of wonderful client-side javascript library Parsley.js by @guillaumepotier., (*1)

The ParsleyjsServerBundle allows to get Symfony 2 form server-side validation on a field type via form validations., (*2)

It uses the data-remote attribute of client-side Parsley.js library. For more informations see here., (*3)

Add ParsleyJsServerBundle to your project:, (*4)

$ php composer.phar require mysportconnect/parsley-server-bundle
$ php composer.phar update

Add the bundle to your AppKernel.php file:, (*5)

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // Your bundles
            new Parsley\ServerBundle\ParsleyServerBundle()
        );

Add configuration to your config.yml file. As ParsleyJsServerBundle depends on your form validations, not your entities, you must provide information on each form there is a field you want to "remote-validate". You doing this by providing validation_groups for your forms:, (*6)

parsley_server:
    validations:
        fos_user_registration: { group: [Registration], translation_domain: validators}
        fos_user_profile: { group: [Profile], translation_domain: validators}

Then add routing information to your routing.yml file:, (*7)

parsley:
    resource: "@ParsleyServerBundle/Resources/config/routing.yml"
    prefix: /parsley

Finally enable Parsley validation on the field you want to like this:, (*8)

    public function buildForm ( FormBuilderInterface $builder , array $options )
    {
        $builder
            -> add ( 'username' , null , array (
                                        "parsley" => true
            ) )
    }

News

IRC on irc.freenode.net #mysportconnect, (*9)

License

ParsleyjsServerBundle is licensed under the MIT license (see LICENSE.md file)., (*10)

Author

mySportConnect, Alain Bangoula (aka comensee), RĂ©mi Barbe (aka Remiii) and contributors., (*11)

Bug report and Help

For bug reports open a Github ticket. Patches gratefully accepted. :-), (*12)

The Versions

08/01 2014

dev-master

9999999-dev

Allow to get Symfony 2 form server-side validation on a field type

  Sources   Download

MIT

The Requires

 

by Alain Bangoula
by RĂ©mi Barbe