kyawnaingtun/tounicode
Composer 安装命令:
composer require kyawnaingtun/tounicode
包简介
"Laravel zawgyi to unicode converter"
README 文档
README
ဇော်ဂျီဖြင့် ရေးသားထားသော input values များကို unicode(ယူနီကုဒ်) အဖြစ် automatic ပြောင်းလဲပေးမည့် laravel package လေးတစ်ခုပါ။ Zawgyi/Unicode အား auto detect သိဖို့ရန်အတွက် ကူညီပေးသော ကွီးဖြိုးဇော်ထွန်း အား အထူးကျေးဇူးတင်ရှိပါသည်။ :D (မှတ်ချက်။။ converter ၏ unicode font သို့ ပြောင်းလဲမှုသည် ၁၀၀% မမှန်နိုင်ပါ။)
AngularJs (Front-End) အတွက်ဆိုရင်တော့ ဒီမှာ လာယူပါ။
composer နဲ့ဘယ်လိုယူရမလဲ?
composer require kyawnaingtun/tounicode
Auto Convert on Save
အရင်ဆုံး ယခု converter ကိုအသုံးပြုမည့် Model file ထဲသို့သွားပါ။ အောက်ပါအတိုင်း TounicodeTrait ကို ထည့်ပါ၊ သင်ပြောင်းလဲလိုသော table field name ကို ဒီထဲမှာ protected $tounicode=[] ထည့်ပေးပါ။ အထက်ပါလုပ်ဆောင်ချက်အားလုံးပြီးပါက၊ ယခု Post model မှ title နှင့် content သည် user ထည့်လိုက်သည့် data မှန်သမျှ အားလုံးကို unicode auto ပြောင်းပေးသွားမည်ဖြစ်သည်။ ထို့အပြင်၊ ယခင်ကရှိနှင့်ပြီးသား Zawgyi content များကိုလည်း Unicode ပြောင်းပြီး ပြန်ထုတ်ပေးမှာ ဖြစ်ပါသည်။
# your-model-folder/post.php namespace App; use Illuminate\Database\Eloquent\Model; use Kyawnaingtun\Tounicode\TounicodeTrait; class Post extends Model { use TounicodeTrait; protected $table = 'post'; protected $fillable = ['title', 'content']; /** * These are the attributes to convert before saving. * To covert automatically from Non-Unicode to Unicode fonts * @var array */ protected $tounicode = ['title','content']; }
Global Helper functions
သင်ပြောင်းလဲလိုသော value ကို အောက်ပါ function အသုံးပြုပြီး ပြောင်းလဲနိုင်သည်။
tounicode($value);//will convert to unicode value
ဖောင့်အမျိုးအစားသိချင်လျှင် အောက်ပါ function ဖြင့်စစ်နိုင်သည်။
/** * return string: uni, zg, mm, eng * uni = unicode * zg = zawgyi * mm = myanmar font * eng = english */ checkFontType($value);
Conclusion
ဒီ laravel package လေးကို အသုံးပြုပြီးတော့ zawgyi နှင့် unicode ပြဿနာအား တစိတ်တပိုင်းဖြေရှင်းနိုင်လိမ့်မည်ဟု ယုံကြည်ပါတယ်။
Supported Versions
| Laravel Version | Supported |
|---|---|
| 11.* | ✅ |
| 10.* | ✅ |
| 9.* | ✅ |
| 8.* | ✅ |
| 7.* | ✅ |
| 6.* | ✅ |
| 5.* | ✅ |
| < 5.0 | ❌ |
Credits
Ko Phyo Zaw Tun (Future ICT Solution) Ko Saturngod (Rabbit) Ko Satkyar (mmfont)
kyawnaingtun/tounicode 适用场景与选型建议
kyawnaingtun/tounicode 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.02k 次下载、GitHub Stars 达 13, 最近一次更新时间为 2016 年 12 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 kyawnaingtun/tounicode 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 kyawnaingtun/tounicode 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 1.02k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 13
- 点击次数: 11
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-12-02