PHP code example of a2lix / translation-form-bundle
1. Go to this page and download the library: Download a2lix/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/ */
a2lix / translation-form-bundle example snippets
use A2lix\TranslationFormBundle\Form\Type\TranslationsType;
use Symfony\Component\Form\Extension\Core\Type\FormType;
$builder->add('translations', TranslationsType::class, [
'translatable_class' => App\Entity\Post::class,
// Optional:
// 'locale_labels' => ['en' => 'English', 'fr' => 'Français'],
// 'theming_granularity' => 'field', // or 'locale_field'
]);
use A2lix\TranslationFormBundle\Form\Type\TranslationsLocalesSelectorType;
$builder->add('locales', TranslationsLocalesSelectorType::class, [
// uses the bundle's LocaleProvider to populate choices
]);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.