PHP code example of omouren / document-id-form-bundle

1. Go to this page and download the library: Download omouren/document-id-form-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/ */

    

omouren / document-id-form-bundle example snippets



// app/AppKernel.php
//...
public function registerBundles()
{
    $bundles = array(
        ...
        new Omouren\DocumentIdFormBundle\OmourenDocumentIdFormBundle(),
        ...
    );
...


//...
$builder
    ->add('city', 'document_id', [
        'class' => 'Project\Entity\City',
    ])
    ;


//...
$builder
    ->add('city', 'document_id', array(
        'class' => 'Project\Entity\City',
        'hidden' => false,
        'label' => 'Enter the City id'
    ))
    ;


//...
$builder
    ->add('recipient', 'document_id', array(
        'class' => 'Project\Entity\User',
        'hidden' => false,
        'property' => 'login',
        'label' => 'Recipient login'
    ))
    ;