2017 © Pedro Peláez
 

symfony-bundle emoji-bundle

Translates emoji characters to HTML/CSS

image

oh/emoji-bundle

Translates emoji characters to HTML/CSS

  • Monday, February 27, 2017
  • by ollietb
  • Repository
  • 1 Watchers
  • 0 Stars
  • 23,146 Installations
  • CSS
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

OhEmojiBundle

Symfony2 bundle which uses php-emoji to create a Twig extension that converts iPhone emoji icons to html., (*1)

Installation

Install this bundle as usual by adding to deps:, (*2)

// /deps
[OhEmojiBundle]
   git=https://github.com/ollietb/OhEmojiBundle
   target=/bundles/Oh/EmojiBundle

and running the vendors script, (*3)

php bin/vendors install

Register the namespace in app/autoload.php:, (*4)

// app/autoload.php
$loader->registerNamespaces(array(
    // ...
    'Oh' => __DIR__.'/../vendor/bundles',
));

Register the bundle in app/AppKernel.php:, (*5)

// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new Oh\EmojiBundle\OhEmojiBundle(),
    );
}

Add the following line to app/config/config.yml:, (*6)

imports:
    - { resource: @OhEmojiBundle/Resources/config/services.yml }

finally publish the assets, (*7)

php app/console assets:install --symlink web

and include the css in your stylesheets, (*8)

<link rel="stylesheet" href="{{asset('bundles/ohemoji/css/emoji.css')}}">

Usage (Twig)

iphone_emoji

Simply use the function to automatically wrap spans around your emoji characters., (*9)

{{ "This text contains some emoji !" | iphone_emoji }}

Would output, (*10)

This text contains some emoji <span class="emoji emoji1f4f1"></span>!

There's also a google_emoji function, because for some reason they use different standards., (*11)

Tests

Not needed - this is just a Symfony2 wrapper for another library which has its own tests https://github.com/iamcal/php-emoji, (*12)

Credits

  • Ollie Harridge (ollietb) as main author.
  • Cal Henderson (iamcal) for writing the converter script [https://github.com/iamcal/php-emoji]

The Versions

27/02 2017

dev-master

9999999-dev https://github.com/ollieLtd/OhEmojiBundle

Translates emoji characters to HTML/CSS

  Sources   Download

MIT

The Requires

 

by Ollie Harridge

emoji