devinci-it/quick-form 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

devinci-it/quick-form

Composer 安装命令:

composer require devinci-it/quick-form

包简介

Quick-Form is a lightweight PHP library designed to streamline the creation of HTML forms in your PHP applications. It provides a simple and intuitive interface for generating HTML forms with ease.

README 文档

README

The Devinci\QuickForm library provides a convenient way to generate HTML forms dynamically in PHP applications. With this library, developers can easily create and customize forms with various input types, set form attributes, and handle form rendering seamlessly.

Features

  • FormBuilder Class: The core component of the library, allowing for the programmatic creation of HTML forms.
  • Support for Multiple Input Types: Text inputs, integer inputs, text areas, date inputs, radio buttons, and checkboxes are all supported.
  • Form Attribute Management: Easily set form attributes such as method, action, class, and id.
  • Input Grouping: Group input fields together for better organization and presentation within the form.
  • Submit and Clear Buttons: Set submit and clear buttons with customizable attributes.
  • Customization: Flexibility to customize form elements, attributes, and buttons according to requirements.

Installation

You can install the Devinci\QuickForm library via Composer:

composer require devinci-it/quick-form

Alternatively, you can include the necessary files manually in your project.

Usage

  1. Instantiate FormBuilder: Create an instance of the FormBuilder class by providing the form action and, optionally, the form submission method and a custom HTML renderer.

    $formBuilder = new FormBuilder('/submit-form', 'POST');
  2. Set Form Attributes: Optionally, set attributes for the form tag using the setFormAttributes method.

    $formBuilder->setFormAttributes([
        'class' => 'my-form',
        'id' => 'my-form-id'
    ]);
  3. Add Input Fields: Add input fields to the form using methods like addTextInput, addIntegerInput, addTextArea, etc.

    $formBuilder->addTextInput('username', 'Enter your username', ['class' => 'form-control']);
    $formBuilder->addIntegerInput('age', 'Enter your age');
  4. Group Inputs: Group input fields together using the setInputGroup method if needed.

    $formBuilder->setInputGroup('personal_info', ['username', 'age']);
  5. Set Submit and Clear Buttons: Set the submit button and clear button using the setSubmitButton and setClearButton methods respectively.

    $formBuilder->setSubmitButton('submit', 'Submit Form', ['class' => 'btn btn-primary']);
    $formBuilder->setClearButton('clear', 'Clear Form', ['class' => 'btn btn-secondary']);
  6. Render the Form: Render the form HTML using the render method.

    echo $formBuilder->render();
  7. Integration with Web Applications: Integrate the generated forms seamlessly into your web applications by embedding them within HTML pages or templates.

  8. Customization: Customize the appearance and behavior of forms by modifying CSS styles, JavaScript interactions, and form processing logic as per your application's requirements.

Examples

The Devinci QuickForm library can be used for various use cases including:

  • User Registration Forms
  • Data Entry Forms
  • Contact Forms
  • Survey Forms

Contribution

Contributions to the Devinci QuickForm library are welcome! Feel free to submit bug reports, feature requests, or pull requests via GitHub.

License

This library is licensed under the MIT License. See the LICENSE file for details.

devinci-it/quick-form 适用场景与选型建议

devinci-it/quick-form 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 15 次下载、GitHub Stars 达 1, 最近一次更新时间为 2024 年 04 月 12 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 devinci-it/quick-form 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 devinci-it/quick-form 我们能提供哪些服务?
定制开发 / 二次开发

基于 devinci-it/quick-form 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-04-12