Переводчик
класс Переводчик расширяет Переводчик реализует WarmableInterface
Переводчик.
Методы
| __construct(ContainerInterface $container, MessageFormatterInterface $formatter, string $defaultLocale, array $loaderIds = array(), array $options = array()) Конструктор. | ||
| warmUp(string $cacheDir) Запускает кэширование. | ||
| addResource($format, $resource, $locale, $domain = null) |
Подробности
__construct(ContainerInterface $container, MessageFormatterInterface $formatter, string $defaultLocale, array $loaderIds = array(), array $options = array())
Конструктор.
Доступные параметры:
- cache_dir: Директория кэша (или null для отключения кэширования)
- debug: Включить отладку (по умолчанию false)
- resource_files: Список доступных ресурсов перевода, сгруппированных по языку.
Параметры
| ContainerInterface | $container | Экземпляр ContainerInterface |
| MessageFormatterInterface | $formatter | Форматтер сообщений |
| string | $defaultLocale | |
| array | $loaderIds | Массив идентификаторов загрузчиков |
| array | $options | Массив параметров |
Исключения
| InvalidArgumentException |
warmUp(string $cacheDir)
Запускает кэширование.
Параметры
| string | $cacheDir | Директория кэша |
addResource($format, $resource, $locale, $domain = null)
Параметры
| $format | ||
| $resource | ||
| $locale | ||
| $domain |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/4.0/Symfony/Bundle/FrameworkBundle/Translation/Translator.html