定制 dft/silverstripe-file-icons 二次开发

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

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

dft/silverstripe-file-icons

最新稳定版本:1.0.0

Composer 安装命令:

composer require dft/silverstripe-file-icons

包简介

Determine an icon class for uploaded files, based on extension

README 文档

README

Attempt to generate an icon string based on the extension of a file.

By default, this returns a relevent FontAwesome icon class.

NOTE: This module does not install any icon libraries, it only allows you to more easily assign an icon to files in your themes.

Install

Install via composer:

composer require "dft/silverstripe-file-icons"

Usage

Once installed, you can add use the following in your templates:

$File.IconClasses

For example, if you wanted to generate a bootstrap button with FontAwesome icon, you could use:

<% with $File %>
<a class="btn btn-primary">
    <i class="{$IconClasses}"></i>
    Download {$Title}
</a>
<% end_with %>

Changing Icons

All icons are mapped via YML config (_config/fileicons.yml), you can map custom classes by overwriting the default config provided by this module.

统计信息

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

GitHub 信息

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

其他信息

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