Welcome Guest, Not a member yet? Register   Sign In
MidgetForms
#21

[eluser]Benjamin Midget[/eluser]
I'm nearly finished with version 1.0 of MidgetForms. This version will be compatible with IR 1.0 and has a number of other improvements.

I am completely swamped with work right now, but maybe I can finish it up next week.
#22

[eluser]sofbas[/eluser]
Great, really looking forward to it. Smile
#23

[eluser]macigniter[/eluser]
Thank you so much for all your work and efforts with MF. I think you rock because you really understand that people want single-file extensions with unoffensive name spaces Smile I love your form builder and can't wait to see the next version of it! Thanks again
#24

[eluser]macigniter[/eluser]
While reading through the documentation I found some bugs you might want to correct:

1. http://www.avanthill.com/mfmanual/doku.p...on:install

$this->load->libaray('form');
SHOULD BE
$this->load->library('form');

2. http://www.avanthill.com/mfmanual/doku.p...onfig_file

This file must be located in /applications and be named form.php
SHOULD BE
This file must be located in /applications/config and be named form.php

3. http://www.avanthill.com/mfmanual/doku.p...uick_start

In the "Controller" section you have forgotten the "d" in Midget 3 times

4. http://www.avanthill.com/mfmanual/doku.p...hods:alias

alias(element, alias)
SHOULDN'T IT BE
alias(element=alias,...)

5. http://www.avanthill.com/mfmanual/doku.p...ethods:add

The default input type for >add() is text
SHOULD BE
The default input type for add() is text

Also below the example the <strong> tags showed up as code and didn't format the words "email" and "E-mail".

6. http://www.avanthill.com/mfmanual/doku.p...ethods:add
Here you are using: add(name, info)
http://www.avanthill.com/mfmanual/doku.p...thods:text
Here you are using: text(name, tags)
For consistency it should be either "info" or "tags"

Overall, for consistency in the reference section I would suggest to put the tag usage either in the headline (http://www.avanthill.com/mfmanual/doku.p...ethods:add) or in an extra box (http://www.avanthill.com/mfmanual/doku.p...thods:ftag). I would personally prefer the blue box over the headline since it's more visible.

Thanks again!
#25

[eluser]Benjamin Midget[/eluser]
@macigniter: Thanks I really appreciate it. I'll make sure the references follow the consistent style when I release 1.0.
#26

[eluser]Benjamin Midget[/eluser]
It'll be ready next week. I'm estimating mid-week (just in time for christmas!) and I want to give y'all a bit of a preview of 1.0.

First off, there will be two versions: one for PHP 4 and another for PHP 5 (the latter will be released first as its nearly finished.) I think it's important to always support PHP 4 since CI does.

Another thing is there will be no more camelCase. Sorry for those who love it. I just find it much less readable and all functions and internal variables use underscores. (It's open source, though, and you could easily change that).

MidgetForms 1.0 is a true OO approach to form generation. For example, now you can directly manipulate each element as an object:

Code:
$this->form->name = new Element('name');
$this->form->name->add_class('newClass');
$this->form->name->size = 20;
$this->form->name->rule = 'checkname[1]';

is the same as

Code:
$this->form->add('name');
$this->form->add_class('name', 'newClass');
$this->form->set('name', 'size');
$this->form->add_rule('name', 'checkname[1]');

Perhaps the former syntax is a bit more bulky, and most people will continue to use chaining to properly set up forms with very little writing, but the fact that you can manipulate anything as a true object is nice.

Also using ORM (IgnitedRecord) is much simpler. All you need to do is add a couple things to the model itself and you've got an instant formatted form.

The config file is simpler and more powerful, allowing multiple defaults.

You can use MidgetForms for multiple forms on a single page.

1.0 utilizes all of CI's built-in validation methods and pre_filters for no repeated code and framework uniformity.

New syntax for self-defining rules and callbacks:
Code:
$this->form->name->rule = 'checkname[val1, val2][val3, val4]';

// this rule will function like this

$values = array('val1', 'val2');
$more_values = array('val3', 'val4');
checkname($values, $more_values);

This way, your custom callbacks (for label filters, pre filters, validation rules) are extremely readable and able to pass multiple parameters—even as arrays if you like.
#27

[eluser]macigniter[/eluser]
hi benjamin,

any news on the next release of midget forms?
#28

[eluser]macigniter[/eluser]
1. Can anyone let me know if validating worked for you? I just can't get a custom validation to work. Neither the rules that I set on-the-fly nor the rules that have been added in the config file seem to work. I hope somebody can explain how to use this properly.

Code:
$this->form
->setRule('numbers', '/^[0-9]+$/', 'Numbers only')
->onSuccess('redirect','login/success')
->add('user')
->tag('label','<b>Username</b>')
->pass('pass')
->tag('label','<b>Password</b>')
->validate('pass','numbers')
->sub('Login');
        
$data['form'] = $this->form->validation()->get();

2. Also i don't understand why i need to set a field to notRequired. Shouldn't a field that wasn't explicitly set to "required" be not required by default?
#29

[eluser]Benjamin Midget[/eluser]
I've moved on to Kohana where I couldn't be happier, and thus I will only be supporting this library for Kohana

The equivalent library for Kohana is called Formo. You will find it much more advanced, simpler to use, and stable than MF.

You can read about and get Formo here:

Formo Site

Sorry to all I told I would be porting Formo to CodeIgniter. It's just too much hassle for a framework I never even use any more.
#30

[eluser]macigniter[/eluser]
Sorry to hear that you moved away from CodeIgniter. Since I was waiting for an update on MidgetForms for quite a while I decided to create a form generation library for CI on my own, based on your great work with MidgetForms.

It will soon be available. For further information check out this post:
http://ellislab.com/forums/viewthread/107861/P0/

Thanks Benjamin, for the all the great work you put into MF and the CI community!




Theme © iAndrew 2016 - Forum software by © MyBB