承接 fullscreeninteractive/silverstripe-ajaxuniquetextfield 相关项目开发

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

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

fullscreeninteractive/silverstripe-ajaxuniquetextfield

Composer 安装命令:

composer require fullscreeninteractive/silverstripe-ajaxuniquetextfield

包简介

Text field that checks uniqueness via AJAX and server-side validation for a DataObject field.

README 文档

README

CI

Provides AjaxUniqueTextField with client and server-side uniqueness validation on a DataObject field, an HTTP JSON endpoint, and a jQuery Entwine client script (load jQuery and Entwine in your project; the CMS admin already includes them).

Requirements

  • SilverStripe CMS 6.x (silverstripe/framework ^6)
  • PHP 8.3 or newer

Installation

Install with Composer from your project root (the same directory as your site’s composer.json):

composer require fullscreeninteractive/silverstripe-ajaxuniquetextfield

Then rebuild the database manifest so configuration and routes are picked up:

vendor/bin/sake dev/build flush=1

Or open /dev/build?flush=1 in the browser while logged in as an administrator.

Exposed module assets are published by the vendor plugin. If JavaScript does not load after an upgrade, run:

composer vendor-expose

Usage

use FullscreenInteractive\AjaxUniqueTextField\AjaxUniqueTextField;

$fields->push(
    AjaxUniqueTextField::create('Slug', 'URL segment', $this->Slug)
        ->setRecordClass(MyRecord::class)
        ->setUniqueField('Slug')
        ->setExcludeID($this->ID) // when editing an existing record
        // ->setValidateURL('https://example.com/custom-check') // optional
        // ->setRestrictedRegex('^[a-z0-9-]+$') // optional client-side gate before AJAX
);

The constructor matches TextField: name, title, value, optional maxLength, optional Form. Configure the DataObject class and field name with setRecordClass() and setUniqueField() before the field is rendered or validated.

Development

  • composer test — PHPUnit (requires MySQL; see vendor/silverstripe/framework/tests/bootstrap/environment.php for defaults).
  • composer phpcs — PSR-12 via PHP_CodeSniffer.
  • composer phpstan — static analysis.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2026-04-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固