2017 © Pedro Peláez
 

library zf2-form-builder

Command-line form generator for Zend Framework 3. Huge timesaver!

image

saeven/zf2-form-builder

Command-line form generator for Zend Framework 3. Huge timesaver!

  • Sunday, January 8, 2017
  • by Saeven
  • Repository
  • 1 Watchers
  • 7 Stars
  • 3,229 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 14 % Grown

The README.md

Laminas Powertools

Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

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., (*2)

PLUS, it also writes controllers., (*3)

THEN, it'll open them in your PHPStorm (or whatever else)., (*4)

It's a CLI tool, is extremely lightweight, and is very simple to use., (*5)

https://user-images.githubusercontent.com/887224/117239821-79662300-adfd-11eb-88f7-3cd53bcdeaec.mov, (*6)

Installation

composer require --dev saeven/zf2-form-builder

Then, add it to your application.config.php (laminas-mvc) with Circlical\LaminasTools., (*7)

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)., (*8)

What a chore to even write that!, (*9)

Well, this tool turns all that into a one-liner., (*10)

vendor/bin/laminas ct:form

Answer the questions, and you're off to the races., (*11)

Controllers

It'll write controllers as well., (*12)

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:, (*13)

'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., (*14)

This tool has been a huge timesaver for me, but please feel free to recommend improvements! I also accept cookie recipes., (*15)

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.

The Versions

08/01 2017

dev-master

9999999-dev https://github.com/Saeven/zf2-circlical-formtool

Command-line form generator for Zend Framework 3. Huge timesaver!

  Sources   Download

MIT

The Requires

 

form zf2 zend framework forms generate

08/10 2016

0.9

0.9.0.0 https://github.com/Saeven/zf2-circlical-formtool

Form and InputFilter generator for Zend Framework 2. Huge timesaver!

  Sources   Download

MIT

The Requires

  • php >=5.5

 

form zf2 zend framework forms generate