Skip to content

Instantly share code, notes, and snippets.

@xabbuh
Created February 8, 2025 20:25
Show Gist options
  • Save xabbuh/4e58da745fabc4255e82f086f1a7f7cc to your computer and use it in GitHub Desktop.
Save xabbuh/4e58da745fabc4255e82f086f1a7f7cc to your computer and use it in GitHub Desktop.
<?php
namespace App\Form\Extension;
use Symfony\Component\Form\AbstractTypeExtension;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\OptionsResolver\OptionsResolver;
class LabelTranslationDomainExtension extends AbstractTypeExtension
{
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefault('translation_domain', 'form_labels');
}
public static function getExtendedTypes(): iterable
{
yield FormType::class;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment