Skip to content
/ Twemoji Public

The better way to use Twemoji with Symfony 6 to 7. Based on Unicode version 15.1.0 emoji.

License

Notifications You must be signed in to change notification settings

Pyrrah/Twemoji

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pyrrah/Twemoji 😉

Latest Version on Packagist Software License Total Contributors Total 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.

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 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

  1. To install this bundle, run the following Composer command :
composer require pyrrah/twemoji
  1. 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://twemoji.maxcdn.com/v/14.0.2/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.

About

The better way to use Twemoji with Symfony 6 to 7. Based on Unicode version 15.1.0 emoji.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages