jonnybarnes/emoji-a11y 问题修复 & 功能扩展

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

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

jonnybarnes/emoji-a11y

Composer 安装命令:

composer require jonnybarnes/emoji-a11y

包简介

Make emoji more accessible

README 文档

README

Make emoji more accessible.

Install

Add this package with composer:

composer require jonnybarnes/emoji-a11y

Usage

Anywhere you have some text with emoji use the makeEmojiAccessible method.

$emoji = new Jonnybarnes\EmojiA11y\EmojiModifier();
$text = 'I’m 😀';
$emoji->makeEmojiAccessible($text); // I’m <span role="img" aria-label="grinning face">😀</span>

Customise HTML

You can pass in a string to the constructor that will be used in the makeEmojiAccessible method. We use PHP’s sprinf function.

Three variables are passed into the function. The desired output form, then the text of the emoji, then the matched emoji character. Thankfully sprintf allows you to swap variable order if you need to, see example 3 in the manual.

Of course you need to provide your own CSS for presentation.

Inspired by http://adrianroselli.com/2016/12/accessible-emoji-tweaked.html

统计信息

  • 总下载量: 1.25k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: CC0-1.0
  • 更新时间: 2017-02-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固