PHP code example of acseo / form-js-validation-bundle

1. Go to this page and download the library: Download acseo/form-js-validation-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

acseo / form-js-validation-bundle example snippets



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


//...
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);
    // ...