PHP code example of uerka / translation-form-bundle

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

    

uerka / translation-form-bundle example snippets

 
return [
    ...
    Uerka\TranslationFormBundle\UerkaTranslationFormBundle::class => ['all' => true],
 
public function registerBundles()
{
    $bundles = [
    ...
    new Uerka\TranslationFormBundle\UerkaTranslationFormBundle(),
}

...
use Uerka\TranslationFormBundle\Form\Type\TranslationsType;

class ExampleFormType extends AbstractType
{
    /**
     * {@inheritdoc}
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('translations', TranslationsType::class, [
                'locales' => ['ru', 'en', 'fr'], // optional, defaults to bundle's config
                'get_class' => TextareaType::class,
                        'options' => [
                            'label' => 'form.label.short_description',
                            '
yaml
uerka_translation_form: 
    locales: ["ru", "en"]