Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/abei2017/yii2-emoji
- Owner: abei2017
- Created: 2017-08-16T00:44:33.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-04T08:49:43.000Z (about 7 years ago)
- Last Synced: 2024-10-01T14:25:08.553Z (3 months ago)
- Topics: emoji, emojione, yii2, yii2-extension
- Language: PHP
- Homepage: https://nai8.me
- Size: 12.7 KB
- Stars: 17
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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