Download the PHP package fp/jsformvalidator-bundle without Composer

On this page you can find all versions of the php package fp/jsformvalidator-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package jsformvalidator-bundle

FpJsFormValidatorBundle

CI Total Downloads

FpJsFormValidatorBundle converts Symfony form validation metadata into JavaScript validation rules and attaches client-side validators to rendered forms.

Development Moves To Svaroh/JsFormValidatorBundle

Active development continues at Svaroh/JsFormValidatorBundle, maintained by Svaroh, under the new Composer package svaroh/jsformvalidator-bundle. That is a new package with its own version history starting at 1.0, not a 2.0 of this one, and it renames the project's identifiers from Fp/fp to Svaroh/svaroh, so switching over requires changes in your application.

1.x stays here. This repository remains the home of the 1.x line and of the fp/jsformvalidator-bundle package, and 1.8.0 stays available. With development moved to Svaroh, 1.x receives no further fixes from the maintainers. Pull requests against 1.x are still welcome here and will be merged.

Existing 1.x installations keep working and need no changes.

Status

This branch has been revived for the current PHP/Symfony baseline:

The old Symfony 2/3 + Assetic + Selenium test application was replaced upstream by a newer Tests/app fixture. The maintained test commands now cover the PHP model/factory/controller core, JavaScript constraints, and a Cypress smoke test against the Symfony test application.

For older Symfony applications, use the historical branches:

Installation

Install the bundle with Composer:

If you are testing this revived branch before a tagged release, require the development branch explicitly:

Register the bundle in config/bundles.php:

Configuration

Validation is enabled for every form by default. You can disable it globally:

Per-form and per-field disabling is documented in Disabling validation.

UniqueEntity Route

If you use Symfony's Doctrine UniqueEntity constraint, import the bundle route:

Make sure your security configuration allows requests to this route.

JavaScript Assets

There are two common ways to load the JavaScript files.

Add an Encore Entry

Then include the entry in your template:

Import From Your Main JavaScript

Adjust the import path to your application structure.

Render Bundle Config And Form Models

After the scripts are loaded, render the generated config and queued form models:

If you need manual initialization for a specific form or event, see manual initialization.

Usage

After the bundle is registered, the form extension adds every enabled root form to an internal queue. Calling init_js_validation() renders JavaScript models for the queued forms:

You can pass false as the second argument to avoid automatic initialization on page load:

Documentation

  1. Disabling validation
  2. Forms in sub-requests
  3. Manual initialization

Customization

This bundle finds related DOM elements for each Symfony form element and attaches an object validator to them. The validator contains the properties and methods that define the validation process for that form element.

If your form rendering is customized, start with custom rendering notes.

  1. Disable validation for a specified field
  2. Error display
  3. Get validation groups from a closure
  4. Getters validation
  5. The Callback constraint
  6. The Choice constraint callback
  7. Custom constraints
  8. Custom data transformers
  9. Checking entity uniqueness
  10. Form submit by JavaScript
  11. onValidate callback
  12. Run validation on custom event
  13. Collections validation

Development

The recommended development environment is the Nix shell:

It provides the latest PHP available in the pinned nixpkgs input, currently PHP 8.5, with Xdebug coverage support, Composer, Node.js 24, npm, zip/unzip, and Cypress runtime libraries. If flakes are not enabled globally, prefix Nix commands with nix --extra-experimental-features "nix-command flakes".

For a fresh checkout:

If Cypress reports a missing binary, install it into the local cache:

You can also run commands without entering the shell:

Without Nix, install PHP 8.4 or newer, Composer, Node.js 24, npm, and the Cypress system dependencies locally before running the same commands.

To install vendors via Docker instead of host PHP/Composer:

Install or refresh Composer dependencies:

Run the PHP test suite:

Run PHPStan static analysis:

Run PHP coverage:

Run the JavaScript unit tests and Cypress browser smoke test:

Run JavaScript coverage:

Useful local checks:

The same maintained test, static-analysis, and coverage checks are also run by GitHub Actions on pushes and pull requests. Coverage runs generate Cobertura reports and upload them to GitHub Code Quality when workflow permissions allow.

The Docker stack uses PHP 8.5, Composer 2, and Node.js 24. It is maintained for dependency installation and ad hoc local commands; Nix remains the preferred environment for exact local parity with the documented checks.


All versions of jsformvalidator-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
doctrine/persistence Version ^2.5 || ^3.0 || ^4.0
symfony/config Version ^5.4 || ^6.4 || ^7.0
symfony/dependency-injection Version ^5.4 || ^6.4 || ^7.0
symfony/doctrine-bridge Version ^5.4 || ^6.4 || ^7.0
symfony/form Version ^5.4 || ^6.4 || ^7.0
symfony/http-foundation Version ^5.4 || ^6.4 || ^7.0
symfony/http-kernel Version ^5.4 || ^6.4 || ^7.0
symfony/routing Version ^5.4 || ^6.4 || ^7.0
symfony/translation-contracts Version ^2.5 || ^3.0
symfony/validator Version ^5.4 || ^6.4 || ^7.0
twig/twig Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package fp/jsformvalidator-bundle contains the following files

Loading the files please wait ...