Form Generation Library - 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: Form Generation Library (/showthread.php?tid=16439) |
Form Generation Library - El Forum - 06-17-2009 [eluser]Robert May[/eluser] Just set up a fresh CI install, going to get to work on it! It's going to be a part of my planned CI CMS, as it would save me acres of time in the long run! Currently planned features: Basic admin panel Form generator must be able to create forms that can be parsed into templates Designed to work wherever you want it, including the admin area User restrictions on where a form can be used (prevent from putting an add content form on the homepage, for example) Creates a DB table for each form, effectively building the CMS DB Stores all variables for the form library in the DB, including validation Now, I can't guarantee that this will be built quickly, or completed, as my attention span can wilt from time to time, but I'm enthusiastic about it as it'll save me time in future projects! And @got 2 doodle, I've been thinking of making it more admin-based for creating a CMS. The form generator could be hidden from the end-user. It's an awesome feature of Symphony CMS that I saw recently, and I'd like to make a more general one for CI use. Form Generation Library - El Forum - 06-17-2009 [eluser]got 2 doodle[/eluser] @macigniter is the multiple config files working? or am I doing something wrong in config file Code: $nameasid[1] = TRUE; in controller Code: $form = new Form(); gives me 'undefined index' errors here libraries/Form.php Line Number: 733 - 761 Code: $this->config['globals'] = (array_key_exists(1, $globals)) ? $globals[$key] : $globals; any thoughts? doodle Form Generation Library - El Forum - 06-17-2009 [eluser]Paul T[/eluser] [quote author="macigniter" date="1245159910"]Hi Paul, can you please forward your mods to the library (please send to info (at) frankmichel (dot) com) so I can take a look and integrate it into future versions? Maybe I can come up with a solution to that usability issue...[/quote] Sent you an email. Form Generation Library - El Forum - 06-17-2009 [eluser]got 2 doodle[/eluser] @macigniter got the multiple configs working for now in library Form.php Code: function Form() Code: $form = new Form(); You must call the config() method but it's a hack that works for me now. If you don't comment out $this->config then the value never gets passed doodle Form Generation Library - El Forum - 06-17-2009 [eluser]macigniter[/eluser] [quote author="got 2 doodle" date="1245263841"]@macigniter is the multiple config files working? or am I doing something wrong any thoughts? doodle[/quote] I fixed this. Please substitute the config function in Form.php with this one: Code: /** I will include this in the next version and upload tomorrow. I am also working on some other minor improvements in the config() function. Form Generation Library - El Forum - 06-17-2009 [eluser]got 2 doodle[/eluser] @macigniter Excellent, thank you it works! :coolsmile: <--- look at that happy face! doodle Form Generation Library - El Forum - 06-17-2009 [eluser]macigniter[/eluser] [quote author="got 2 doodle" date="1245259936"] Quote:it would be pretty easy to implement database-created forms using this library @Robert May That's cool, I had exactly the same thought but I'm not convinced that it would save any time, but it would be a cool feature to include in a cms. I don't think processing would be too hard, the table could include - table name - field name - type of control - action But when I got to thinking about how to process the form, I started wondering who would benefit. Usually end users are freaked out by editing a text field. I don't know how they would do with creating their own forms. At best the forms would have to be minimal. doodle[/quote] I think a great contribution to this library would be an "online form builder" for the form generation library. To save all of us programmers (not for the end-user) some typing and just let us click our forms together and then spit out the form generation library code that we can just copy and paste into our controller. Just a thought... Form Generation Library - El Forum - 06-17-2009 [eluser]Robert May[/eluser] That could be a useful by-product of what I had planned actually. That will prove quite easy methinks, and I could optionally have it generate the SQL for a relevant table for the form. It shouldn't actually take too long to come up with that. I can't seem to find a list of all available options for the library, is there any chance you could list all validation options and field types? That way I can stick them in select boxes! Form Generation Library - El Forum - 06-18-2009 [eluser]Cyclops[/eluser] Hey, Mr FormGenLib, Great work! A framework should not be without a library like this. One quick question: Is there a way to define validation rules in a file, or in an array somewhere, and then have the $form object load the specified rules up for each specific form? This would be very nice if similar forms will be used in more than one place (like as in create / edit / ajaxEdit, etc). Any help would be great Form Generation Library - El Forum - 06-24-2009 [eluser]bEz[/eluser] @cyclops Are you referring to defined validation rules by way of a ruleset, and in a config file? for instance: (off the top of me head) Code: $config['form_rule_set] = array ( |