Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 23912 программистов и 1389 роботов. Сейчас ищут 1467 программистов ...

Class Summary Translation2_Decorator_Lang

Вернуться к: Translation2

Class Summary Translation2_Decorator_Lang

Class Summary Translation2_Decorator_Lang – Decorator to provide a fallback language for empty strings.

This decorator is very useful when you want to provide a fallback language for empty strings. It is stackable, so you can have more than one default language. Use setOption() with the fallbackLang parameter to specify the fallback language of the current decorator.

<?php
$tr 
= new Translation2($driver$dbinfo$params);

//set English as the main language
$tr->setLang('en');

//set Italian as the first fallback language
$tr =& $tr->getDecorator('Lang');
$tr->setOption('fallbackLang''it');

//set Spanish as the second fallback language
$tr =& $tr->getDecorator('Lang');
$tr->setOption('fallbackLang''es');
?>



Вернуться к: Translation2

© 2024 «PHP.RU — Сообщество PHP-Программистов»
Главная | Форум | Реклама на сайте | Контакты VIP Сувениры
Разработка компании ODware