PHP code example of it / input-mask-bundle

1. Go to this page and download the library: Download it/input-mask-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/ */

    

it / input-mask-bundle example snippets


// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        // ...
        new IT\InputMaskBundle\ITInputMaskBundle(),
        // ...
    );
}

    // Will result of a single_widget date picker
    use IT\InputMaskBundle\Form\Type\DateMaskType;
    use IT\InputMaskBundle\Form\Type\EmailMaskType;
    use IT\InputMaskBundle\Form\Type\UrlMaskType;
    //...
    $builder
        ->add('birthdate', DateMaskType::class, array(
            'label' => 'Date of birth',
        ))
        ->add('email', EmailMaskType::class, array(
            'label' => 'Email field',
        ))
        ->add('url', UrlMaskType::class, array(
            'label' => 'Url field',
        ))
    ;

    // Will result of a text widget with the format "[0-9]{2}\.[0-9]{2}\.[0-9]{2}\.[0-9]{2}\.[0-9]{2}"
    use IT\InputMaskBundle\Form\Type\TextMaskType;
    //...
    $builder
        ->add('phone', TextMaskType::class, array(
            'label' => 'Phone number',
            'mask' => '99.99.99.99.99'
        ))
    ;

    // Will result of a text widget with the format "[0-9]{2}\.[0-9]{2}\.[0-9]{2}\.[0-9]{2}\.[0-9]{2}"
    use IT\InputMaskBundle\Form\Type\TextMaskType;
    //...
    $builder
        ->add('phone', RegexMaskType::class, array(
            'label' => 'Phone number',
            'regex' => '[0-9]{2}\.[0-9]{2}\.[0-9]{2}\.[0-9]{2}\.[0-9]{2}'
        ))
    ;