dev-master
9999999-dev https://github.com/pstaender/silverstripe-emoji-parserEmoji Parser for SilverStripe
MIT License
The Requires
- php >=5.2.0
by Philipp Staender
parser silverstripe emoji
Wallogit.com
2017 © Pedro Peláez
Emoji Parser for SilverStripe
Render Emojis in your template, so that a :smile: becomes a real :smile:, (*1)
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;
}
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",
…
}
You can optionally configure these values in your config.yml:, (*9)
Emojis:
basePath: pathToGraphics
cssClass: classNameForCSS
Implement alternate unicode characters., (*10)
The images are taken from Emoji-Cheat-Sheet.com and are under different Licenses., (*11)
This module is under The MIT License (MIT)., (*12)
Emoji Parser for SilverStripe
MIT License
parser silverstripe emoji