K3 form library

Shad Laws <shad-xpYdmXCiSuZWk0Htik3J/[email protected]> Wed, 20 Mar 2013 13:52:16 +0100
Newsgroups gmane.comp.web.gallery.devel
Message-ID <CA+z51A52w2QYF5pWvxQmB--AnaiWABeiZDfRoB=y8Nm+0-dc7w@mail.gmail.com>
Hey gang,

So, the Forge we used in K2 is gone.  Replacing it is probably going to be
one of the stickier points of the K2->K3 process, especially for contrib
modules.

I've started peeking at K3-compatible alternatives, and have found three
principal options:
1. Formo module
2. Forge module
3. the built-in Form and Validation classes

--

FORMO

In fact, version 1.x (K2 compatible) was suggested a long time ago (
https://sourceforge.net/apps/trac/gallery/ticket/652).  Version 2.x is for
K3, and is here:
https://github.com/bmidget/kohana-formo

It seems to be fairly actively maintained... and it has docs!
https://github.com/bmidget/kohana-formo/blob/master/guide/formo/menu.md

This seems to be a pretty good way to go.

--

FORGE

I stumbled across this:
https://github.com/kohana-addons/forge

... which appears to be a K3-compatible version of Forge.  Excited by the
prospect of a simpler swap, I took a glance at its source... and learned
that it doesn't seem to share the same API as the old one.  In other words,
it doesn't appear to be any easier/harder to implement than Formo.

However, it does appear to have less documentation and less active
maintenance (only a single commit).

--

BUILT-IN CLASSES

We could also forgo using object-oriented forms altogether and use the base
Form class to make the views and the base Validation class to check the
entries before we write them.  In fact, googling around for K3 form modules
lands upon several sites that suggest that this is the simpler way to go.

Some pros:
- no extra modules to keep up with and/or go out of date
- easier division of view and controller (Form is used in the view to make
the form, Validation is used in the controller to process the inputs)
Some cons:
- need to implement our own error messages, etc.
- no tie-in with ORM (although I think this is a Forge/Formo capability we
don't really use anyway, no?)
- not object-oriented
- probably harder to translate existing modules to use this method

--

My current opinion is that Formo is the way to go.  Thoughts?

Take care,
Shad

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar

__[ g a l l e r y - d e v e l ]_________________________

[ list info/archive --> http://gallery.sf.net/lists.php ]
[ gallery info/FAQ/download --> http://gallery.sf.net ]