saeven/zf2-form-builder 问题修复 & 功能扩展

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

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

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

Latest Stable Version Total Downloads Latest Unstable Version License

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.

统计信息

  • 总下载量: 17.14k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-07-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固