saeven/zf2-form-builder
Composer 安装命令:
composer require saeven/zf2-form-builder
包简介
Powertools for much lazy with Laminas because I hate writing Controllers, Forms, InputFilters, their Factories, and you hate writing all that stuff too.
README 文档
README
Ok. Let's face it. Wiring forms with Laminas takes time. I do love Zend Framework and Laminas, but Forms taste like the cardboard at the bottom of your tub of ice cream. I built this form helper to spark a little joy. Forms are just less terrible with this in my composer.json, and in yours too.
PLUS, it also writes controllers.
THEN, it'll open them in your PHPStorm (or whatever else).
It's a CLI tool, is extremely lightweight, and is very simple to use.
powertool-building-forms.mov
Installation
composer require --dev saeven/zf2-form-builder
Then, add it to your application.config.php (laminas-mvc) with Circlical\LaminasTools.
Usage
Forms
Suppose you wanted to create a FooForm, FooFormFactory, FooInputFilter and FooInputFilterFactory in the Bar module, and wire it all up in your form_elements and input_filters config keys (in Bar).
What a chore to even write that!
Well, this tool turns all that into a one-liner.
vendor/bin/laminas ct:form
Answer the questions, and you're off to the races.
Controllers
It'll write controllers as well.
vendor/bin/laminas ct:controller
Successfully Achieve 98% Lazy
All you have to do, is pull those config files into your module.config.php like so:
'form_elements' => require forms.config.php,
'input_filters' => require inputfilters.config.php,
How's that for service! You can kick up your feet, tinker with your Pomodoro timer and rake in that same hourly wage with a maximized degree of relaxation.
This tool has been a huge timesaver for me, but please feel free to recommend improvements! I also accept cookie recipes.
Some Notes
- Assumes you are structuring your modules like module/Foo/src/Controller
- I could have dug deep and created some nice abstractions, but I didn't.
- Didn't care enough to write tests for now. Hammered this last version out real fast, wanted it for another project that has a ton of forms and controllers on the horizon.
saeven/zf2-form-builder 适用场景与选型建议
saeven/zf2-form-builder 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 17.14k 次下载、GitHub Stars 达 9, 最近一次更新时间为 2015 年 07 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「form」 「Forms」 「tools」 「utilities」 「generate」 「laminas」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 saeven/zf2-form-builder 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 saeven/zf2-form-builder 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 saeven/zf2-form-builder 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A set of useful PHP classes.
A Laravel package to retrieve data from Google Search Console
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
Diese Contao 4 Erweiterung stellt Google reCAPTCHA V2 in Form eines neuen Formularfeldes im Formulargenerator bereit. This extension provides Google reCAPTCHA V2 in the form of a new form field in the form generator of Contao Open Source CMS.
HTML and form generation
统计信息
- 总下载量: 17.14k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-07-07