jaedb/iconfield
最新稳定版本:1.0.2
Composer 安装命令:
composer require jaedb/iconfield
包简介
Icon field for SilverStripe
关键字:
README 文档
README
Simplifies the use of icons in a way content authors can set icons without interfering with the asset library. Instead, the web developer provides the icon set which the end-user can use but not manipulate.
Requirements
- SilverStripe 4
Usage
- Import the required classes:
use Jaedb\IconField\Icon;
use Jaedb\IconField\IconField;
- Set your
$dbfield to typeIcon(eg'PageIcon' => Icon::class) IconField::create($name, $title, $iconFolder)$nameis the database field as defined in your class$titleis the label for this field$iconFolder(optional) defines the directory where your icons can be found. Defaults to/site/icons.- To change your default icon directory, see
_config/config.yml. - Use your icon in templates as you would any other property (eg
$PageIcon). If your icon is an SVG, the SVG image data will be injected into the template. To prevent this, you can call$PageIcon.IMGinstead to enforce use of<img>tags.
统计信息
- 总下载量: 15.13k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2018-02-21