syntro/silverstripe-bootstrap-forms
Composer 安装命令:
composer require syntro/silverstripe-bootstrap-forms
包简介
Silverstripe module adding formfields for use in the frontend
README 文档
README
Silverstripe module for adding bootstrap forms to the frontend more easily.
Introduction
Creating forms compatible with the Bootstrap CSS framework using the provided form fields by Silverstripe is not an easy thing to do. Silverstripes' internally used form fields are not intended to be frontend fields in the first place, meaning the framework is very opinionated about how these fields are rendered in the admin UI and imposes these standards for frontend fields. These standards however are not very compatible with Bootstrap, especially Bootstrap v5.
To counter this, this module introduces a new set of fields, which behave like
the originals, but render in a bootstrap compatible way. They also add a separate
holderClasses attribute, which allows the easy formatting of forms using
spacing classes.
Installation
To install this module, run the following command:
composer require syntro/silverstripe-bootstrap-forms
Usage
Quick Start
The following fields are available currently:
use Syntro\SilverstripeBootstrapForms\Forms\CheckboxField; use Syntro\SilverstripeBootstrapForms\Forms\CheckboxSetField; use Syntro\SilverstripeBootstrapForms\Forms\DropdownField; use Syntro\SilverstripeBootstrapForms\Forms\EmailField; use Syntro\SilverstripeBootstrapForms\Forms\OptionsetField; use Syntro\SilverstripeBootstrapForms\Forms\TextareaField; use Syntro\SilverstripeBootstrapForms\Forms\TextField; // does not have the HolderClass trait use Syntro\SilverstripeBootstrapForms\Forms\FieldGroup;
All fields have an extra set of methods, analogous the extraClass ones:
holderClass()setupDefaultHolderClasses()hasHolderClass($class)addHolderClass($class)removeHolderClass($class)
They behave the exact same way as their xxxExtraClass counterparts, but they
control the class on the outer (holder) div.
Example
To create a good looking multi-column form, simply add the correct classes:
FieldGroup::create( TextField::create('Name', 'Your Name')->addHolderClass('col'), EmailField::create('Email', 'Email')->addHolderClass('col'), DropdownField::create( 'choose', 'Choose an option', [ 'yes' => 'Yes', 'no' => 'No' ] )->addHolderClass('col'), )->addExtraClass('row row-cols-1 row-cols-md-3'),
Docs
no docs yet
Contributing
See CONTRIBUTION.md for mor info.
syntro/silverstripe-bootstrap-forms 适用场景与选型建议
syntro/silverstripe-bootstrap-forms 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.71k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 05 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「silverstripe」 「frontend forms」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 syntro/silverstripe-bootstrap-forms 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 syntro/silverstripe-bootstrap-forms 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 syntro/silverstripe-bootstrap-forms 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
ConfirmationField is a form field for Atk14 applications. It's like the BooleanField (checkbox) but the ConfirmationField must be ticked.
Field for number with restricted count of digits and decimal places
Query filtering in your frontend
Article CSS-ID Frontend Output Optimization
Analytics chooser extensions for site settings.
统计信息
- 总下载量: 3.71k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2022-05-06