PHP code example of a2lix / auto-form-bundle

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

    

a2lix / auto-form-bundle example snippets


//  bundles.php is automatically updated if flex is installed.
// ...
A2lix\AutoFormBundle\A2lixAutoFormBundle::class => ['all' => true],
// ...

use A2lix\AutoFormBundle\Form\Type\AutoFormType;
...
$builder->add('medias', AutoFormType::class);

use A2lix\AutoFormBundle\Form\Type\AutoFormType;
...
$builder->add('medias', AutoFormType::class, [
    'fields' => [                               // [2]
        'description' => [                         // [3.a]
            'field_type' => 'textarea',                // [4]
            'label' => 'descript.',                    // [4]
            'locale_options' => [                  // [3.b]
                'es' => ['label' => 'descripción']     // [4]
                'fr' => ['display' => false]           // [4]
            ]
        ]
    ],
    'excluded_fields' => ['details']            // [2]
]);