Backend\Core\Engine\Language::setWorkingLanguage PHP Method

setWorkingLanguage() public static method

Set the current working language
public static setWorkingLanguage ( string $language )
$language string The language to use, if not provided we will use the working language.
    public static function setWorkingLanguage($language)
    {
        trigger_error('Backend\\Core\\Engine\\Language is deprecated.
             It has been moved to Backend\\Core\\Language\\Language', E_USER_DEPRECATED);
        parent::setWorkingLanguage($language);
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @param string $language
  * @throws Exception If the provided language is not valid
  */
 public function setLanguage($language)
 {
     // get the possible languages
     $possibleLanguages = Language::getWorkingLanguages();
     // validate
     if (!in_array($language, array_keys($possibleLanguages))) {
         throw new Exception('Language invalid.');
     }
     // set working language
     Language::setWorkingLanguage($language);
 }
All Usage Examples Of Backend\Core\Engine\Language::setWorkingLanguage