mikica / zf2-translate-plugin
简单的翻译控制器插件。
2.01
2018-07-13 20:43 UTC
Requires
- php: >=5.6
- zendframework/zend-i18n: ^2.6
- zendframework/zend-mvc: ^3.0
This package is auto-updated.
Last update: 2024-08-27 03:33:12 UTC
README
安装 Zend 3
composer require mikica/zf2-translate-plugin
安装 Zend 2
composer require mikica/zf2-translate-plugin "^1.0"
您需要注册新模块。在文件 config/application.config.php 中添加以下内容
'modules' => array(
'...',
'ZfTranslate'
),
该模块已准备好使用。
在控制器中使用
<?php $this->translate('translate word'); $this->translate('translate word', 'locale');