yangshihe / yii2-emoji
Yii2 emoji
Installs: 83
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/yangshihe/yii2-emoji
Requires
- php: >=5.4.0
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2025-10-12 01:53:22 UTC
README
基于Yii2 处理emoji表情,这次到位。 顾不得格式了,简单些几句.
描述
安装
Either run
$ composer require yangshihe/yii2-emoji
to the require
section of your composer.json
file.
配置相关
后端部分 use yangshihe\emoji\Emoji; //实现方式: (比如微信公众号的昵称含有表情)则如下: $emoji = new Emoji(); $nickname = $emoji->emoji_unified_to_html($data['nickname']); // OR $nickname = (new Emoji())->emoji_unified_to_html($data['nickname']); // 然后存入数据库神马的 //........ //前端部分 需要视图的部分// use yangshihe\emoji\EmojiAsset; //按需加载 EmojiAsset::register($this->getView()); //OR //依赖加载 //AppAsset.php public $depends = [ 'yii\web\YiiAsset', .......code......... 'yangshihe\emoji\EmojiAsset' ]; // 然后你就能看到和微信一模一样的表情了.
Demo
暂无