Symfony\Component\Form\FormConfiguration::setDefaultLocale PHP Method

setDefaultLocale() public static method

Sets the default locale for newly created forms.
public static setDefaultLocale ( string $defaultLocale )
$defaultLocale string
    static public function setDefaultLocale($defaultLocale)
    {
        self::$defaultLocale = $defaultLocale;
    }

Usage Example

Example #1
0
 public function testLocalesAreSelectable()
 {
     FormConfiguration::setDefaultLocale('de_AT');
     $field = new LocaleField('language');
     $choices = $field->getOtherChoices();
     $this->assertArrayHasKey('en', $choices);
     $this->assertEquals('Englisch', $choices['en']);
     $this->assertArrayHasKey('en_GB', $choices);
     $this->assertEquals('Englisch (Vereinigtes Königreich)', $choices['en_GB']);
     $this->assertArrayHasKey('zh_Hans_MO', $choices);
     $this->assertEquals('Chinesisch (vereinfacht, Sonderverwaltungszone Macao)', $choices['zh_Hans_MO']);
 }
All Usage Examples Of Symfony\Component\Form\FormConfiguration::setDefaultLocale