定制 kravcik/nette-macro-fontawesome 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

kravcik/nette-macro-fontawesome

最新稳定版本:v4.0.4

Composer 安装命令:

composer require kravcik/nette-macro-fontawesome

包简介

Simple macro for Nette framework, which allow short entry of font-awesome icons.

README 文档

README

This repo is discontinued - for Latte3 and PHP8.1 you should look here: https://github.com/kravcik/latte-font-awesome-icon

Simple macro for generating Font Awesome icons. First parameter is required. Parameters can be set in order or randomly with string keys (macro detects if it's getting an associative array).

Version 2.0.0

It's compatible with FontAwesome 5, but default style is set to light. Best option would be to create multiple macros or a static variable to set default style. Send me a PR or create an issue if you need this.

Thanks to @peldax it's also possible to change the html element. Default is span.

Register to config.neon

latte:
    macros:
        - Kravcik\Macros\FontAwesomeMacro::install

Parameters

  1. icon - icon name without fa-
  2. color - color (blue, red-dark, etc.)
  3. size - number (generates fa-{size}x) or sm, lg, etc.
  4. fw - if TRUE, disable fa-fw
  5. style - fas / far / fal / fab

Examples

{icon star, 'el' => 'i'} -> <i class="fal fa-star fa-fw"></i>

{icon star} -> <span class="fal fa-star fa-fw"></span>

{icon star, red} -> <span class="fal fa-star color-red fa-fw"></span>

{icon star, NULL, lg} -> <span class="fal fa-star fa-lg fa-fw"></span>

{icon star, yellow, 2} -> <span class="fal fa-star color-yellow fa-2x fa-fw"></span>

{icon star, blue, 2, TRUE, far} -> <span class="far fa-star color-blue fa-2x"></span>

{icon star, size => 2, fw => TRUE, color => 'green-light', style => 'fas'} -> <span class="fas fa-star color-green-light fa-2x"></span>

Versions

Package PHP Nette Font Awesome Bootstrap
v4 >=8.0 >=3.0 5 4
v3 >=7.3 >=3.0 5 4
v2 >=7.1 >=2.4 5 3
v1 >=5.6 >=2.4 4 3

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-02-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固