2017 © Pedro Peláez
 

silverstripe-module silverstripe-emoji-parser

Emoji Parser for SilverStripe

image

pstaender/silverstripe-emoji-parser

Emoji Parser for SilverStripe

  • Saturday, February 11, 2017
  • by pstaender
  • Repository
  • 1 Watchers
  • 0 Stars
  • 346 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 2 Open issues
  • 1 Versions
  • 5 % Grown

The README.md

:star::star::star: Emoji Parser for SilverStripe :star::star::star:

Render Emojis in your template, so that a :smile: becomes a real :smile:, (*1)

Usage

Copy or clone the project to your SilverStripe instance folder or using composer:, (*2)

  composer require pstaender/silverstripe-emoji-parser dev-master

Wheny you're done flush SilverStripe cache with ?flush=1., (*3)

In your templates you can now parse Emojis with:, (*4)

  <h1>$Title</h1>
  $Content.Parse(Emoji)

Of course also in combination with other parsers:, (*5)

  <h1>$Title</h1>
  $Content.Parse(BBCodeParser).Parse(Emoji)

All rendered icon-image-tags contain the class emoji so that you can easily define a style, for instance:, (*6)

   img.emoji {
     height: 1em;
     margin: 0 1em 0 1em;
   }

JSON for clientside JavaScript usage

You can access all emojis including the url to graphics by requesting Emojis_Controller:, (*7)

  http://yourserver/Emojis_Controller/

and use the responded JSON:, (*8)

{

    "100": "silverstripe-emoji-parser/graphics/emojis/100.png",
    "-1": "silverstripe-emoji-parser/graphics/emojis/-1.png",
    "+1": "silverstripe-emoji-parser/graphics/emojis/+1.png",
    …
}

Optional configuration

You can optionally configure these values in your config.yml:, (*9)

  Emojis:
    basePath: pathToGraphics
    cssClass: classNameForCSS

TODO

Implement alternate unicode characters., (*10)

Original Project and License

The images are taken from Emoji-Cheat-Sheet.com and are under different Licenses., (*11)

This module is under The MIT License (MIT)., (*12)

The Versions

11/02 2017

dev-master

9999999-dev https://github.com/pstaender/silverstripe-emoji-parser

Emoji Parser for SilverStripe

  Sources   Download

MIT License

The Requires

  • php >=5.2.0

 

by Philipp Staender

parser silverstripe emoji