定制 iliain/silverstripe-visualfields 二次开发

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

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

iliain/silverstripe-visualfields

Composer 安装命令:

composer require iliain/silverstripe-visualfields

包简介

Provides a number of CMS fields that display images

README 文档

README

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

Provides similar functionality to heyday/silverstripe-colorpalette, but uses images rather than colours.

Installation (with composer)

composer require iliain/silverstripe-visualfields

Usage

$fields->addFieldToTab('Root.Main', $typeField = VisualOptionField::create('IconType', 'Type', [
    'icon-1' => '/path/to/icon-1.png',
    'icon-2' => '/path/to/icon-2.png',
    'icon-3' => '/path/to/icon-3.png',
    'icon-4' => '/path/to/icon-4.png',
]));

Customising

You can customise the size and background colour of the images with the following options:

$typeField
    ->setOptionWidth('125px')
    ->setOptionHeight('125px')
    ->setOptionBackground('#efe6da') // Only visible if the image has transparency
    ->setBackgroundSize('cover');


You can also use the setReadonly() method to make the field read-only, which will disable the radio buttons and prevent the user from changing the value, but allow them to see the stylised options.

$typeField->setReadonly(true);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2022-07-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固