silverstripe/segment-field
Composer 安装命令:
composer require silverstripe/segment-field
包简介
A reusable approach to segment-generating fields
关键字:
README 文档
README
A reusable approach to segment-generating fields.
Installation
composer require silverstripe/segment-field
Usage
use SilverStripe\Forms\SegmentField; use SilverStripe\Forms\SegmentFieldModifier\SlugSegmentFieldModifier; use SilverStripe\Forms\SegmentFieldModifier\IDSegmentFieldModifier; SegmentField::create('PageName')->setModifiers(array( SlugSegmentFieldModifier::create()->setDefault('page'), array('-', ''), IDSegmentFieldModifier::create(), ))->setPreview($this->PageDisplayName)
- Starting with a value of
"My New Page!". - The value is passed through
SlugSegmentFieldModifier. - Preview value becomes
"My-New-Page", Input value becomes"My-New-Page". - The value is passed through
array('-', ''). - Preview value becomes
"My-New-Page-", Input value becomes"My-New-Page". - The value is passed through
IDSegmentFieldModifier. - Preview value becomes
"My-New-Page-1"(with the DataObject ID), Input value becomes"My-New-Page".
You can pass any similarly structured array or implementation of SilverStripe\Forms\SegmentFieldModifier in the modifiers list.
Using on the frontend
This field is primarily designed for use within the Silverstripe CMS. If you want to use it on the frontend, please ensure that you have included your own version of jQuery and the jQuery entwine library that ships with the silverstripe/admin module, for example:
Requirements::javascript('//code.jquery.com/jquery-3.3.1.min.js'); Requirements::javascript('silverstripe/admin:thirdparty/jquery-entwine/dist/jquery.entwine-dist.js');
These dependencies are included by default when using this field within the CMS.
Versioning
This library follows Semver. According to Semver, you will be able to upgrade to any minor or patch version of this library without any breaking changes to the public API. Semver also requires that we clearly define the public API for this library.
All methods, with public visibility, are part of the public API. All other methods are not part of the public API. Where possible, we'll try to keep protected methods backwards-compatible in minor/patch versions, but if you're overriding methods then please test your work before upgrading.
Thanks
I'd like to thank SilverStripe for letting me work on fun projects like this. Feel free to talk to me about using the framework and CMS or working at SilverStripe.
silverstripe/segment-field 适用场景与选型建议
silverstripe/segment-field 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.04M 次下载、GitHub Stars 达 7, 最近一次更新时间为 2015 年 08 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「silverstripe」 「segment」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 silverstripe/segment-field 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 silverstripe/segment-field 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 silverstripe/segment-field 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PHP library for reporting events to the Segment.io API
Segment.com PHP SDK
PHP Session Manager (non-blocking, flash, segment, session encryption).
Analytics chooser extensions for site settings.
A Segment bridge for Laravel by Alt-Three
统计信息
- 总下载量: 1.04M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 19
- 依赖项目数: 7
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-08-11