mistralys/html_quickform2
Composer 安装命令:
composer require mistralys/html_quickform2
包简介
Provides methods to create, validate and render HTML forms in PHP.
README 文档
README
This fork focuses on code modernization, performance and quality of life improvements.
Requirements
- PHP 7.4+ (PHP8 compatible)
- Composer
Installation
Add as dependency to your composer.json file with:
composer require mistralys/html_quickform2
Also see the Packagist page.
Additions and improvements
- Chainable element methods as alternative to attribute arrays.
- Element factory class for easy element creation.
- Better code completion support through typed return values.
- Ongoing overall code modernization with strict typing.
- Quality of life improvements overall.
- Removed dependencies on PEAR packages.
Some changes in detail:
- Elements:
set/getRuntimeProperty()method to store data at runtime - Default array datasource:
setValues()method - Textarea element:
setRows()/setColumns()methods - Elements:
makeOptional()method to remove any required rules - Elements:
hasErrors()method to check if an element has errors after validation - Elements:
getRules()method to retrieve all rules added to the element - Elements:
hasRules()method to check if an element has any rules - Elements:
addRuleXXX()shorthand methods, includingaddRuleRequired(). - Elements:
appendComment()method to append text to an existing comment. - Elements:
setComment()extended to allowStringablevalues. - Elements:
isFrozen()method to check if an element is frozen. - Containers:
requireElementById()with non-null return value. - Text-based elements:
addFilterTrim()method. - Select element:
prependOption()method to insert an element at the top. - Select element: Support for selects with a custom OptGroup class.
- Select element: OptGroups
getLabel()method. - Select element:
countOptions()method with recursive capability. - Select Element: Added
makeMultiple()andisMultiple(). - Select Element: Added
setSize()andgetSize(). - Select Element: Added
getSelectedOption(). - Date element: Setter and getter methods for options.
- Input elements: Added
setLabel()method where relevant. - Checkbox element: Added
setChecked()method. - Image element: Added
setURL()method. - Button Element: Added
makeSubmit()andmakeButton(). - Form: Added
getMethod(). - Form: Added
makeMultiPart()andisMultiPart(). - Rules: The callback rule now has a method
getCallback()to retrieve the configured callback. - Rules: Added static
setDefaultMessage()to the required rule. - Renderers: Added setters and getters for renderer options.
- Renderers: Added specialized proxy classes to assist with IDE code completion.
- Renderers: Added proxy factory methods like
createArray()andcreateCallback(). - Renderers: Added a Bootstrap5 renderer.
Performance tweaks
- Container
getElementById()method. - Auto-generated element IDs.
Element ID generation
The element ID generation mechanism has been modified, so it is no longer possible to rely on a specific naming scheme to predict the automatic element IDs. In practice, this was impractical at best anyway, and the new system has big performance gains.
Documentation
See the main branch for details and documentation: https://github.com/pear/HTML_QuickForm2
Additional documentation is available in the docs/knowledgebase folder, in the form of Markdown files.
mistralys/html_quickform2 适用场景与选型建议
mistralys/html_quickform2 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 51.01k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2019 年 10 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「javascript」 「wizard」 「validation」 「Forms」 「quickform」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mistralys/html_quickform2 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mistralys/html_quickform2 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mistralys/html_quickform2 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Generates a Blade directive exporting all of your named Laravel routes. Also provides a nice route() helper function in JavaScript.
Caching and compression for Twig assets (JavaScript and CSS).
A pretty nice way to expose your translation messages to your JavaScript.
Site generator / tree model duplicator used to generate mini-website or duplicate tree model
PHP client for the Google Closure Compiler API in one file.
Adds request-parameter validation to the SLIM 3.x PHP framework
统计信息
- 总下载量: 51.01k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 6
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2019-10-08