Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP Framework for form-intensive application

I'm looking for a simple-to-learn php framework for an application that is being migrated from Access to PHP. The application has lots of forms (sometimes 50+ fields per page), and lots of the fields are inter-dependent (ie, you change one field, it updates some other fields or options).

Is there any good php framework for this? I would prefer it really simple since:

  • The devs are not so experienced
  • The DB is being migrated from Access and was not designed with OOP in mind, it's basically a collection of tables divided by functionality, so I probably don't need any ORM (at least for now).

The most important thing is really the ease of form design and fields correlation (ex: two list boxes where the values of the second depends of the selected value of the first) - I know most ajax libs have some support for this but I would like it out of the box.


edit: As a clarification, the most important is not the ajax nifty stuff, although it is important. The important is a straightforward way to create db-based forms. The db is not designed with an ORM in mind, so I don't need fancy table associations on the ORM layer whith cascade deletes etc. If an ORM layer doesn't get in the way and simplifies the implementation so that's ok but i doubt this will ever be true.

like image 280
Miguel Ping Avatar asked Mar 26 '09 12:03

Miguel Ping


3 Answers

I've just done a similar but much more simple application using codeIgniter, which has a pretty nice form helper

Examples of code:

form_hidden('userName', 'johndoe');
// Would produce: <input type="hidden" name="username" value="johndoe" />

form_input('username', @$_POST['userName'])
// Would produce an input populated with a variable  from the post array

And you can do allsorts using arrays etc:

$js = 'id="shirts" onChange="some_function();"';

echo form_dropdown('shirts', $options, 'large', $js);
like image 81
jsims281 Avatar answered Sep 18 '22 13:09

jsims281


While I'll certainly add my support behind the excellent and simple to learn CodeIgniter I fear everyone so far is missing the elephant in the room regarding this question.

To be perfectly honest I don't think any framework is going to make assembling an application with 50+ forms per page simpler or easy for Developers without much experience. Especially with the added requirement of ajax ready support for dropdown dependencies.

Having said that, if you're looking for power and flexibilty I'd select Zend. If you're looking for straight simplicity I'd choose CodeIgniter.

like image 39
Steerpike Avatar answered Sep 18 '22 13:09

Steerpike


Code Igniter has some very good documentation regarding forms and handles a lot of the complexities for you.

The form validation class is documented here: http://codeigniter.com/user_guide/libraries/form_validation.html

There is also a form helper class which makes creating forms very easy.

http://codeigniter.com/user_guide/helpers/form_helper.html

It is certainly easier than building a web app from scratch!


(source: codeigniter.com)

like image 23
Jon Winstanley Avatar answered Sep 19 '22 13:09

Jon Winstanley