Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/abei2017/yii2-emoji

πŸ˜„ this is a emoji extension of yii2.
https://github.com/abei2017/yii2-emoji

emoji emojione yii2 yii2-extension

Last synced: 2 months ago
JSON representation

πŸ˜„ this is a emoji extension of yii2.

Awesome Lists containing this project

README

        







εŒ—ε“₯开源扩展
εŒ—ε“₯开源扩展
εŒ—ε“₯开源扩展


Β  θΏ™ζ˜―δΈ€ε₯—δΎ›yii2ζ‘†ζžΆδ½Ώη”¨ηš„emoji葨情库。






# Install
$ composer require abei2017/yii2-emoji
> only used in yii2.

[Video](http://nai8.me/course-video.html?id=151)

# Usage
```php
use abei2017\emoji\Emoji;
Emoji::shortnameToImage('hello:smile:');// hello πŸ˜„
Emoji::toShort('πŸ˜„'); // :smile:
Emoji::unicodeToImage('πŸ˜„'); // πŸ˜„
Emoji::toImage(':smile:'); // πŸ˜„
Emoji::shortnameToUnicode(':smile:'); // πŸ˜„
```
# Config
```php
// config/web.php
return [
...
'yii2Emoji'=>[
'emojiSize'=>'32',//32、64、128
]
];
```

# Use Behavior (>= v1.1.0)
```php
// in ActiveRecord
use abei2017\emoji\ValBehavior;
public function behaviors(){
return [
'hello'=>[
'class'=>'abei2017\emoji\ValBehavior',
'valAttribute'=>'content',// no set, default "content"
'inFunc'=>'toShort'// no set, default "toShort", and you can set "shortnameToUnicode"
]
];
}
```

# License
MIT