Skip to content

ParsleyjsServerBundle a symfony 2 bundle integration of wonderful client-side javascript library Parsley.js

License

Notifications You must be signed in to change notification settings

mySportConnect/ParsleyjsServerBundle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ParlseyjsServerBundle

A symfony 2 bundle integration of wonderful client-side javascript library Parsley.js by @guillaumepotier.

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

It uses the data-remote attribute of client-side Parsley.js library. For more informations see here.

Add ParsleyJsServerBundle to your project:

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

Add the bundle to your AppKernel.php file:

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:

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:

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

Finally enable Parsley validation on the field you want to like this:

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

News

IRC on irc.freenode.net #mysportconnect

License

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

Author

mySportConnect, Alain Bangoula (aka comensee), Rémi Barbe (aka Remiii) and contributors.

Bug report and Help

For bug reports open a Github ticket. Patches gratefully accepted. :-)

About

ParsleyjsServerBundle a symfony 2 bundle integration of wonderful client-side javascript library Parsley.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages