Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pyrrah/twemoji
The better way to use Twemoji with Symfony 6 (based on Unicode version 15.0.2 emoji)
https://github.com/pyrrah/twemoji
Last synced: about 1 month ago
JSON representation
The better way to use Twemoji with Symfony 6 (based on Unicode version 15.0.2 emoji)
- Host: GitHub
- URL: https://github.com/pyrrah/twemoji
- Owner: Pyrrah
- License: mit
- Created: 2023-09-21T16:32:00.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-19T17:43:37.000Z (12 months ago)
- Last Synced: 2024-05-20T12:46:46.616Z (6 months ago)
- Language: PHP
- Homepage: https://packagist.org/packages/pyrrah/twemoji
- Size: 21.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pyrrah/Twemoji 😉
[![Latest Version on Packagist][ico-version]][link-packagist]
[![Software License][ico-license]](LICENSE)
[![Total Contributors][ico-contributors]][link-contributors]
[![Total Downloads][ico-downloads]][link-downloads]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](https://gitlab.com/Avris/Twemoji).
*Since 2023, @jdecked has stopped working for Twitter but continues to maintain the package on Jdecked/Twemoji. We use the latest version.*
What is Twemoji ?
-----------------[Twemoji](https://github.com/jdecked/twemoji) is a great way to make emoji's on your website independent of system and browser ([old repository](https://github.com/twitter/twemoji)).
Unless you just use this library to replace emojis with `` 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
------------1. To install this bundle, run the following [Composer](https://getcomposer.org/) command :
```
composer require pyrrah/twemoji
```2. If you're using Symfony with autowiring, just register the service(s) :
```yaml
# config/services.yaml
Pyrrah\Twemoji\TwemojiService: ~
Pyrrah\Twemoji\TwemojiExtension: ~
```Usage
-----In your controller :
```
$twemoji->replace('Hello! 👋');
// Hello!
```Using Twig:
```
{% filter twemoji %}
Hello! 👋
{% endfilter %}
``````
yourBestVar|twemoji
```## Tests
```
vendor/bin/phpunit
```Credits
-------- [Pierre-Yves Dick][link-author]
- [Andrea Prusinowski][link-author-origine]
- [All Contributors][link-contributors]License
-------This bundle is under the MIT license. For the full copyright and license
information please view the [License File](LICENSE) that was distributed with this source code.[ico-version]: https://img.shields.io/packagist/v/pyrrah/twemoji.svg?style=flat-square
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
[ico-contributors]: https://img.shields.io/github/contributors/Pyrrah/twemoji?style=flat-square
[ico-downloads]: https://img.shields.io/packagist/dt/pyrrah/twemoji.svg?style=flat-square[link-packagist]: https://packagist.org/packages/pyrrah/twemoji
[link-downloads]: https://packagist.org/packages/pyrrah/twemoji
[link-author]: https://github.com/Pyrrah
[link-author-origine]: https://gitlab.com/Avris
[link-contributors]: ../../contributors