Skip to content

uses https://github.com/iamcal/php-emoji to create a Twig extension that converts iPhone emoji icons to html

Notifications You must be signed in to change notification settings

ollieLtd/OhEmojiBundle

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OhEmojiBundle

Symfony2 bundle which uses php-emoji to create a Twig extension that converts iPhone emoji icons to html.

Installation

Install this bundle as usual by adding to deps:

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

and running the vendors script

php bin/vendors install

Register the namespace in app/autoload.php:

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

Register the bundle in app/AppKernel.php:

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

Add the following line to app/config/config.yml:

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

finally publish the assets

php app/console assets:install --symlink web

and include the css in your stylesheets

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

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

Would output

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.

Tests

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

Credits

About

uses https://github.com/iamcal/php-emoji to create a Twig extension that converts iPhone emoji icons to html

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 94.4%
  • PHP 5.6%