PHPackages                             j-ben87/parsley-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. j-ben87/parsley-bundle

ActiveSymfony-bundle[Validation &amp; Sanitization](/categories/validation)

j-ben87/parsley-bundle
======================

Convert Symfony constraints into data-attributes for client-side validation with Parsley.

v3.1.0(2y ago)1432.7k↑26.7%11MITPHPPHP &gt;=7.4

Since Feb 3Pushed 2y ago3 watchersCompare

[ Source](https://github.com/bjd-php/parsley-bundle)[ Packagist](https://packagist.org/packages/j-ben87/parsley-bundle)[ RSS](/packages/j-ben87-parsley-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (11)Versions (16)Used By (0)

ParsleyBundle
=============

[](#parsleybundle)

[![Build Status](https://camo.githubusercontent.com/13292a9e89adaabfd998f69b8f9fa4548a850602dcc7a340789b29c7d0498faf/68747470733a2f2f7472617669732d63692e636f6d2f626a642d7068702f706172736c65792d62756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/bjd-php/parsley-bundle)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/6df80d8258c16e8f99c2db06a194c547056b6a54f0e3f64f4c9e30a32f9abc67/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f626a642d7068702f706172736c65792d62756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/bjd-php/parsley-bundle/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/c5745afa4e2d4e11876fd31a77eacd17d10d3f8d76b3e4ce1314626370f125f6/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f626a642d7068702f706172736c65792d62756e646c652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/bjd-php/parsley-bundle/?branch=master)

Convert Symfony constraints into data-attributes for client-side validation with [Parsley](http://parsleyjs.org/).

Installation
------------

[](#installation)

Install the bundle with composer:

```
composer require j-ben87/parsley-bundle
```

Install Parsley library:

Configuration
-------------

[](#configuration)

The bundle exposes a basic configuration:

```
jben87_parsley:
    enabled: true           # enable/disable Parsley validation globally (can be enabled on FormType or Constraint level)
    trigger_event: 'blur'   # the JavaScript event for which the validation is to be triggered (relative to the selected input)
```

Usage
-----

[](#usage)

### Form constraints

[](#form-constraints)

Create a `FormType`.

Any supported constraints you have defined on your form will automatically be turned into Parsley data-attributes.

Yes, it's that simple!

```
