定制 moritz-sauer-13/silverstripe-font-awesome-field 二次开发

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

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

moritz-sauer-13/silverstripe-font-awesome-field

最新稳定版本:1.0.1

Composer 安装命令:

composer require moritz-sauer-13/silverstripe-font-awesome-field

包简介

A simple form field for selecting font-awesome classes in the CMS.

README 文档

README

Synopsis

Provides a field to easily pick font-awesome icons

Features

  • Easily pick icons to be used anywhere in the backend
  • Can filter on icon name

Requirements

SilverStripe 5+

Installation

Composer

Ideally composer will be used to install this module. composer require "nickjacobs/silverstripe-font-awesome-field:dev-master"

Screen shots

Font awesome icon view

Font awesome icon

Filter view

Filter

Usage

A basic working example, and the following to any class you want the field on;

use SilverStripe\FontAwesome\FontAwesomeField;

class Blabla extends ... {
    private static $db = array(
        'Icon' => 'Varchar(255)',
    );

    public function getCMSFields()
    {
        $fields = parent::getCMSFields();

        $fields->addFieldsToTab('Root.Main', array(
           FontAwesomeField::create("Icon", "Font Awesome icon")
        ));

        return $fields;
    }
}

Then simple include in the template where you want the icon placed

    <i class="$Icon"></i>  

The controller extension should make sure you've got access to the icons so you don't need to double up the CSS file.

Want colours instead of icons?

Got you covered, checkout color-swabs!

Libraries used/modified

  • Font Awesome > 5

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 11
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2024-06-05