xddesigners/iconselectfield 问题修复 & 功能扩展

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

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

xddesigners/iconselectfield

最新稳定版本:6.0.0

Composer 安装命令:

composer require xddesigners/iconselectfield

包简介

Adds a configurable icon select field

README 文档

README

Add a icon select field to the Silverstripe CMS.

Installation

composer require xddesigners/iconselectfield

Usage

Add a icon field to your db. This field will automaticly scaffold a IconSelectField.

class YourClass extends DataObject
{
  private static $db = [
    'Icon' => 'Icon'
  ];

  public function getCMSFields()
  {
    $fields = parent::getCMSFields();
    $fields->addFieldsToTab('Root.Main', [
      // this field is automaticly scaffolded
      IconSelectField::create('Icon', 'Icon')
    ]);

    $fields;
  }
}

In your template you can now access the Icon property and this will be replaced by the selected icon.

$Icon

You can confugure the icons you want to use trough a yml config.

---
Name: vivabasicIcons
---
XD\IconSelectField\Forms\IconSelectField:
  fonts_include:
  # add your own link to a font awesome version your using
    - '<link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.12.1/css/all.css" crossorigin="anonymous">'
  icons:
    system:
      arrow-right: 'fas fa-arrow-right'
      arrow-left: 'fas fa-arrow-left'
      custom-icon: '<svg />' # you can also configure custom svg icons

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2021-03-04