SimpleSAML\Locale\Language::getLanguageList PHP Метод

getLanguageList() публичный Метод

Return an indexed list of all languages available.
public getLanguageList ( ) : array
Результат array An array holding all the languages available as the keys of the array. The value for each key is true in case that the language specified by that key is currently active, or false otherwise.
    public function getLanguageList()
    {
        $current = $this->getLanguage();
        $list = array_fill_keys($this->availableLanguages, false);
        $list[$current] = true;
        return $list;
    }

Usage Example

Пример #1
0
 /**
  * Test SimpleSAML\Locale\Language::getLanguageList().
  */
 public function testGetLanguageListIncorrectConfig()
 {
     // test non-existent langs
     $c = \SimpleSAML_Configuration::loadFromArray(array('language.available' => array('foo', 'bar')), '', 'simplesaml');
     $l = new Language($c);
     $l->setLanguage('foo');
     $this->assertEquals(array('en' => true), $l->getLanguageList());
 }
All Usage Examples Of SimpleSAML\Locale\Language::getLanguageList