kecik/language
最新稳定版本:1.0.3
Composer 安装命令:
composer require kecik/language
包简介
Language Libararies for Kecik Framework
关键字:
README 文档
README
A library created specifically Kecik Framework, this library was made for ease in making use of multi-language projects.
Installation
composer.json files
{
"require": {
"kecik/language": "1.0.*@dev"
}
}
Run a command
composer install
This library requires a file in json format as a dictionary. Examples json file contents.
nama file: lang_id.json
{
"signin": "Masuk",
"form": {
"validation": {
"must be fill": "Harus diisi"
}
}
}
nama file: lang_us.json
{
"signin": "Sign In",
"form": {
"validation": {
"must be fill": "Must be fill"
}
}
}
Example Using
<?php require "vendor/autoload.php"; $app = new Kecik\Kecik(); $lang = new Kecik\Language(array( 'id'=>'lang_id.json', 'us'=>'lang_us.json' )); $app->get('/', function() use ($lang){ echo 'Indonesia Sign In :'.$lang->id('signin').'<br />'; echo 'English [US] Sign In :'.$lang->us('signin').'<br />'; echo 'Indonesia Must be fill : '.$lang->id('must be fill', array('form', 'validation')).'<br />'; echo 'English [US] Must be fill :'.$lang->us('must be fill', array('form', 'validation')); }); $app->run(); ?>
统计信息
- 总下载量: 145
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-04-01