承接 clesson-de/silverstripe-hints 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

clesson-de/silverstripe-hints

最新稳定版本:1.0.0

Composer 安装命令:

composer require clesson-de/silverstripe-hints

包简介

A Silverstripe CMS form field that displays a collapsible alert hint in the CMS edit form.

README 文档

README

A Silverstripe CMS module providing the HintField form field — a collapsible alert panel for the CMS edit form.

Requirements

  • PHP ^8.1
  • Silverstripe Framework ^6
  • Silverstripe Admin ^3

Installation

composer require clesson-de/silverstripe-hints

After installation, run:

composer vendor-expose

Usage

use Clesson\Silverstripe\Hints\Constants\HintType;
use Clesson\Silverstripe\Hints\Forms\HintField;

// Expanded info hint (default)
$fields->addFieldToTab('Root.Main', HintField::create(
    'MyHint',
    'Important note',
    '<p>Please read this carefully before saving.</p>'
));

// Collapsed warning hint
$fields->addFieldToTab('Root.Main', HintField::create(
    'MyWarning',
    'Warning',
    '<p>This action cannot be undone.</p>'
)->setType(HintType::WARNING)->setCollapsed(true));

Available types

Constant Visual style
HintType::INFO Blue
HintType::WARNING Yellow
HintType::DANGER Red
HintType::SUCCESS Green

API

Method Description
setContent(string $html) Sets the HTML body content.
setType(string $type) Sets the alert type (use HintType constants).
setCollapsed(bool $flag) Sets whether the alert starts collapsed.

Frontend Assets

The module ships with pre-compiled CSS in client/admin/dist/. The CSS is automatically loaded by the field when it is rendered.

If you want to modify the styles, recompile them:

Prerequisites

nvm use 20
npm install

Build

npm run build

This compiles client/admin/src/scss/main.scssclient/admin/dist/bundle.css.

License

BSD 3-Clause — see LICENSE.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2026-05-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固