Giter VIP home page Giter VIP logo

tounicode's Introduction

ToUnicode (Laravel Easy Converter)

dev-master Download

ဇော်ဂျီဖြင့် ရေးသားထားသော input values များကို unicode(ယူနီကုဒ်) အဖြစ် automatic ပြောင်းလဲပေးမည့် laravel package လေးတစ်ခုပါ။ Zawgyi/Unicode အား auto detect သိဖို့ရန်အတွက် ကူညီပေးသော ကွီးဖြိုးဇော်ထွန်း အား အထူးကျေးဇူးတင်ရှိပါသည်။ :D (မှတ်ချက်။။ converter ၏ unicode font သို့ ပြောင်းလဲမှုသည် ၁၀၀% မမှန်နိုင်ပါ။)

AngularJs (Front-End) အတွက်ဆိုရင်တော့ ဒီမှာ လာယူပါ။

composer နဲ့ဘယ်လိုယူရမလဲ?

composer require kyawnaingtun/tounicode dev-master

Auto Convert on Save

အရင်ဆုံး ယခု converter ကိုအသုံးပြုမည့် Model file ထဲသို့သွားပါ။ အောက်ပါအတိုင်း TounicodeTrait ကို ထည့်ပါ၊ သင်ပြောင်းလဲလိုသော table field name ကို ဒီထဲမှာ protected $convertable=[] ထည့်ပေးပါ။ အထက်ပါလုပ်ဆောင်ချက်အားလုံးပြီးပါက၊ ယခု Post model မှ title နှင့် content သည် user ထည့်လိုက်သည့် data မှန်သမျှ အားလုံးကို unicode auto ပြောင်းပေးသွားမည်ဖြစ်သည်။

# 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 $convertable = ['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 ပြဿနာအား တစိတ်တပိုင်းဖြေရှင်းနိုင်လိမ့်မည်ဟု ယုံကြည်ပါတယ်။

Credits

Ko Phyo Zaw Tun (Miracle Digitech) Ko Saturngod (Rabbit) Ko Satkyar (mmfont)

tounicode's People

Contributors

kyawnaingtun avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.