pyrrah/twemoji
最新稳定版本:v1.1.1
Composer 安装命令:
composer require pyrrah/twemoji
包简介
The simple way to use Twitter Emoji (Twemoji) for Symfony 6.x.
README 文档
README
This bundle allows you to replace emojis on a web page with emojis from the Twitter Emojis library (Twemoji). Usually, the emojis used come from your system and they are different from one system to another.
Based on Avris\Twemoji.
Note
Since 2023, @jdecked no longer works for Twitter but continues to maintain the package on Jdecked/Twemoji. To get the most up-to-date emojis, we use the latest version of the CDN by default.
What is Twemoji ?
Twemoji is a great way to make emoji's on your website independent of system and browser (old repository).
Unless you just use this library to replace emojis with <img> tags in your backend.
Note: it will, of course, increase the server response time (instead removing a flash of system emojis before JS loads). Therefore, it's better suited for generated static websites or HTTP cached requests.
Installation
- To install this bundle, run the following Composer command :
composer require pyrrah/twemoji
- If you're using Symfony with autowiring, just register the service(s) :
# config/services.yaml Pyrrah\Twemoji\TwemojiService: ~ Pyrrah\Twemoji\TwemojiExtension: ~
Usage
In your controller :
$twemoji->replace('Hello! 👋');
// Hello! <img draggable="false" class="emoji" alt="👋" src="https://cdn.jsdelivr.net/gh/jdecked/twemoji@latest/assets/svg/1f44b.svg">
Using Twig:
{% filter twemoji %}
<p>
Hello! 👋
</p>
{% endfilter %}
yourBestVar|twemoji
Tests
vendor/bin/phpunit
Credits
License
This bundle is under the MIT license. For the full copyright and license information please view the License File that was distributed with this source code.
统计信息
- 总下载量: 55
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-09-21