euclid1990/php-ios-emoji 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

euclid1990/php-ios-emoji

Composer 安装命令:

composer require euclid1990/php-ios-emoji

包简介

An iOS Emoji Parser For Laravel 5

README 文档

README

Latest Stable Version Total Downloads License

An iOS emoji parser for Laravel 5. cry

Installation

PHP 5.5+ and Laravel 5 are required.

The PHP iOs Emoji Service Provider can be installed via Composer by requiring the euclid1990/php-ios-emoji package in your project's composer.json.

{
    "require": {
        "laravel/framework": "5.*",
        "euclid1990/php-ios-emoji": "~1.0"
    },
    "minimum-stability": "stable"
}

or

Require this package with composer:

composer require euclid1990/php-ios-emoji

Update your packages with composer update or install with composer install.

Setup

Bootstrap

To use the Emoji Service Provider, you must register the provider when bootstrapping your Laravel application. There are essentially two ways to do this.

Find the providers key in config/app.php and register the Emoji Service Provider.

    'providers' => [
        // ...
        'euclid1990\PhpIosEmoji\Providers\EmojiServiceProvider',
    ]

for Laravel 5.1+

    'providers' => [
        // ...
        euclid1990\PhpIosEmoji\Providers\EmojiServiceProvider::class,
    ]

Find the aliases key in config/app.php.

    'aliases' => [
        // ...
        'Emoji' => 'euclid1990\PhpIosEmoji\Facades\Emoji',
    ]

for Laravel 5.1+

    'aliases' => [
        // ...
        'Emoji' => euclid1990\PhpIosEmoji\Facades\Emoji::class,
    ]

Public Assets

Run following command: It will move all emotion icon images and style.css file to /public/ios-emoji.

php artisan vendor:publish --tag=public --force

Add Stylesheet

Add the style sheet we prepared for you.

<link rel="stylesheet" href="{{ asset('/ios-emoji/css/style.css') }}">

Or use helper:

<link rel="stylesheet" href="{{ ios_emoji_css() }}">

Usage

1. Example:

\Emoji::parse($text);
<!DOCTYPE html>
<html>
<head>
    <title>PHP iOS Emoji</title>
    <link rel="stylesheet" href="{{ ios_emoji_css() }}">
</head>
<body>
    <p>'Parse the emotions: :smiley: :smile: :baby: :blush: :relaxed: :wink: :heart_eyes: :kissing_heart: in this string.'</p>
    <p></p>
    <p>{!! \Emoji::parse('Parse the emotions: :smiley: :smile: :baby: :blush: :relaxed: :wink: :heart_eyes: :kissing_heart: in this string.') !!}</p>
</body>
</html>

Result:

Preview

2. Use Helper:

$text = "Parse the emotions: :smiley: :smile: in this string.";
// iOS Emoji Parser
ios_emoji($text);

Reference

  1. Emoji Alias

统计信息

  • 总下载量: 532
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 8
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-03-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固