1. Go to this page and download the library: Download bic/form-validation 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/ */
bic / form-validation example snippets
//...
new Bic\FormValidationBundle\BicFormValidationBundle()
//...
// form Data models
$formData = array(
new Form\Model\Register(),
new Form\Model\Document()
);
// form builder
$formBuilder = $this->container
->get('form.factory')
->createNamedBuilder('form', 'form', $formData)
->add('phone', 'text')
->add('password', 'password')
->add('document', new Form\Type\DocumentType())
->add('submit', 'submit');
// get form from form builder
// (http://www.interesarte.com/wp-content/uploads/2013/05/willsmith.jpg)
$form = $formBuilder
->getForm()
->handleRequest($request);