2017 © Pedro Pelรกez
 

library emoji-module

An sample Emoji module for Zend Framework 2

image

atans/emoji-module

An sample Emoji module for Zend Framework 2

  • Wednesday, July 31, 2013
  • by atans
  • Repository
  • 2 Watchers
  • 6 Stars
  • 46 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

EmojiModule for Zend Framework 2

Master: Build Status, (*1)

  • 0.1.0 (26/7/2013)

Introduction

A sample emoji module for Zend Framework 2, (*2)

1.๐Ÿ˜ Hello World to :smile: Hello World, (*3)

2.๐Ÿ˜ Hello World to #1f601# Hello World (You can save it to MySQL < 5.5), (*4)

3.#1f601# Hello World to ๐Ÿ˜ Hello World, (*5)

4.๐Ÿ˜ Hello World to <span class="emoji emoji1f601"></span> Hello World, (*6)

5.#1f601# Hello World to <span class="emoji emoji1f601"></span> Hello World, (*7)

Installation

With composer

  1. Add this project in your composer.json:, (*8)

    "require": {
        "atans/emoji-module": "dev-master"
    }
    
  2. Running this command, (*9)

    $ php composer.phar update
    

Post installation

```php
<?php
  return array(
    'modules' => array(
      // ...
      'EmojiModule',
    ),
  );
```

How to use

  1. Call emojimodule_emoji_service in a controller, (*10)

    public function indexAction() {
      $emojiService = $this->getServiceLocator()->get('emojimodule_emoji_service');
      $text = "\xF0\x9F\x98\x81 Hello World";
      $variables = $emojiService->encode($text);
      // Output: #1f601# Hello World (You can save it to MySQL now)
    
      // Variables restore to unified
      $unified = $emojiService->decode($variables);
      // Output: \xF0\x9F\x98\x81 Hello World
    
      // Variables to Html
      $variablesToHtml = $emojiService->variablesToHtml($variables);
      // Output: <span class="emoji emoji1f601"></span> Hello World
    
      // Unified to html
      $unifiedToHtml = $emojiService->unifiedToHtml($unified);
      // Output: <span class="emoji emoji1f601"></span> Hello World
    
      return array(
        'unifiedToHtml' => $unifiedToHtml,
      );
    }
    
  2. View, (*11)

    copy https://raw.github.com/iamcal/php-emoji/master/emoji.css and https://github.com/iamcal/php-emoji/blob/master/emoji.png to '/public/css/', (*12)

    headLink()->appendStylesheet($this->basePath() . '/public/css/emoji.css');
    ?>
    
    
    
  3. View Helper, (*13)

    emoji()->unifiedToHtml('๐Ÿ˜ Hello World')
    // Output:  Hello World
    ?>
    
    

The Versions

31/07 2013

dev-master

9999999-dev https://github.com/atans/EmojiModule

An sample Emoji module for Zend Framework 2

  Sources   Download

MIT

The Requires

 

zendframework emoji

26/07 2013

0.1.0

0.1.0.0 https://github.com/atans/EmojiModule

An sample Emoji module for Zend Framework 2

  Sources   Download

MIT

The Requires

 

zendframework emoji