Yii2 Twemoji
, (*1)
A simple way to add Twemoji support to your Yii2 project., (*2)
Installation
The preferred way to install this extension is through composer., (*3)
Either run, (*4)
php composer.phar require --prefer-dist cozumel/yii2-twemoji "*"
or add, (*5)
"cozumel/yii2-twemoji": "*"
to the require section of your composer.json
file., (*6)
Usage
Once the extension is installed, simply use it in your code by :, (*7)
use cozumel\twemoji\TwemojiAsset;
TwemojiAsset::register($this);
CSS
Because every project will have different size requirements, the css is not part of the extension.
The default size of the emojis is 72x72. You can change this easily with some css., (*8)
img.emoji {
height: 1em;
width: 1em;
margin: 0 .05em 0 .1em;
vertical-align: -0.1em;
}