![]() |
CI Form-Framework 1.0.1 - a form abstraction layer - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: CI Form-Framework 1.0.1 - a form abstraction layer (/showthread.php?tid=42205) Pages:
1
2
|
CI Form-Framework 1.0.1 - a form abstraction layer - El Forum - 05-30-2011 [eluser]benboi[/eluser] CI Form-Framework 1.0.1 Introduction The CI Form-Framework is an abstraction-layer for the creation of forms in Codeigniter. Without having such extension, creating forms is a mess, because you have different places to create the logic and presentation of your forms and there are many things to adjust in a case of changig requirements. This extension fixes that, by just combining some great components of the Codeigniter-Framework to one form-frameworkn and make them manageable in a centralized way, by handling forms equal to models. Features * Centralizes form-handling, presentation and logic in one place * Uses Codeigniter components to get it done * Lets you write less code for forms * Makes it possible to reuse forms for different approaches * Simplyfies input-handling by returning objects/arrays * Everything is an object * Values of a form be saved to session to have multi-page-form support * A custom loader for use with hmvc-extension is provided Requirements This extension was developed and tested for Codeigniter-Reactor. The Core-Edition was not tested but maybe also works without a problem. Libraries and helpers used by the extension are not needed to autoload, because the extension manages it by itself. Installation To install the "CI Form-Framework" get the most recent version of it from https://github.com/benboi/ci-form-framework first, then follow the next steps: 1. copy the application folder from the archive/checkout over your application folder 2. You are done already ![]() Documentation The documentation can be found in the github repository or under http://benboi.net/code/ci-form-framework. Changelog 08.06.2011 - 1.0 * added save to session functionality * provides a customized hmvc loader * fixed some bugs, like refilling radios and checkboxes 08.06.2011 - 1.0.1 * bugfix release * added methods to check if session data form a form is set and to get the data from session as object. CI Form-Framework 1.0.1 - a form abstraction layer - El Forum - 05-30-2011 [eluser]darrentaytay[/eluser] Had a quick skim through the source code and it looks very promising, I shall download it and try it out later ![]() CI Form-Framework 1.0.1 - a form abstraction layer - El Forum - 05-30-2011 [eluser]benboi[/eluser] Hey, just to give a quick preview, how this is working, im writing down some code here. Lets write a contact form: The form-class (application/forms/contact_form.php) Code: <?php The controller (application/controller/contact.php) Code: <?php The view Code: <?php echo $contact_form; ?> This is an really easy example, this extension is capable of a lot of more ![]() Ill keep you up to date an will create a documenation this week ![]() CI Form-Framework 1.0.1 - a form abstraction layer - El Forum - 05-31-2011 [eluser]darrentaytay[/eluser] I've not had a chance to have a proper go at this yet, but one thing that looks like it could be an improvement is method chaining, eg: Code: $this->add('input', 'prename') or even Code: $this->add('input', 'prename'); Makes it a bit neater and easier in my opinion but just a suggestion! CI Form-Framework 1.0.1 - a form abstraction layer - El Forum - 05-31-2011 [eluser]benboi[/eluser] Thanks for your message. Chaining is already there, just didnt want to confuse you folks ^^ I see , there is big need to write that doc. CI Form-Framework 1.0.1 - a form abstraction layer - El Forum - 05-31-2011 [eluser]darrentaytay[/eluser] Ahh I see, so how would it work? Like my example #1 or #2? CI Form-Framework 1.0.1 - a form abstraction layer - El Forum - 05-31-2011 [eluser]codeninja[/eluser] This is brilliant.. ![]() CI Form-Framework 1.0.1 - a form abstraction layer - El Forum - 05-31-2011 [eluser]benboi[/eluser] Added a short documentation, look @ github ![]() CI Form-Framework 1.0.1 - a form abstraction layer - El Forum - 06-01-2011 [eluser]benboi[/eluser] Updatet post number one ![]() CI Form-Framework 1.0.1 - a form abstraction layer - El Forum - 06-01-2011 [eluser]codeninja[/eluser] Are you planning on adding support for multi-page forms (wizards)? |