EllisLab text mark
Advanced Search
     
Automated Form Generation
Posted: 21 June 2007 11:53 AM   [ Ignore ]
Avatar
Joined: 2007-06-11
2985 posts

Call me lazy but there is nothing more boring than making 100’s of CRUD forms for your new admin control panel. There are a few solutions:

Scaffolding: Sadly short term solution and has its obvious flaws like cannot access NULL values and needs a separate controller for each damn table.

CodeCrafter: Is a very intelligent piece of coding, sites that code themselves are not only a dream but in some ways a nightmare… this is my job you are stealing here!! However the code is a little OTT, makes too many folders and is not the best solution.

Rapyd: Any idea how the hell to make this work? Takes me a long time of faffing just to get a simple form done, and again, includes HUNDREDS of files!

Is there any solution to simply create a really simple form from a database? Like, one single controller with a parameter accepting a table name which passes to a library to return a dynamically generated view?

There is no need for all this “Comes with 6 million Javascript libraries and requires a new folder in every single CI folder” its OTT and messy. I do hope there is another CRUD solution as coding one myself would take even longer than making the forms :p

 Signature 

————————
Blog | Twitter | GitHub | BitBucket
————————-
PyroCMS - open source modular CMS built with CodeIgniter
PancakeApp - Simple, hosted invoicing/w project management

 
Posted: 21 June 2007 12:29 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2006-10-02
332 posts

I’ll make the button. wink

 Signature 

Dotted line.

 
Posted: 21 June 2007 04:13 PM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2006-07-25
5 posts

Don’t forget Forge!

 
Posted: 21 June 2007 05:52 PM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Joined: 2006-06-17
151 posts

Look again at CodeCrafter, warts and all.

You don’t have to create code for your entire database. You can choose a single table, then choose whether you want to generate the view, controller, model or any combination of the above,

Why you can even choose to display the code on the screen for easy cut and paste instead of creating the resultant files on disk.

If you don’t like my coding style you can create your own templates for the generated code.

 Signature 

CodeCrafter - Open Source Code Generation for CI

 
Posted: 21 June 2007 08:23 PM   [ Ignore ]   [ # 4 ]   [ Rating: 0 ]
Avatar
Joined: 2007-06-21
114 posts

i tried to use forge, put the files in my CI project, and, errors…i’m sure it’s great but annoying when installing something and it doesn’t work.


Parse error: parse error, expecting `T_OLD_FUNCTION’ or `T_FUNCTION’ or `T_VAR’ or `’}’’ in /Users/me/Sites/egci/system/application/libraries/Forge.php on line 32

 Signature 

GraphicLeftovers.com - Professional Stock Graphics and Images for Less, powered by CodeIgniter

 
Posted: 21 June 2007 08:30 PM   [ Ignore ]   [ # 5 ]   [ Rating: 0 ]
Avatar
Joined: 2007-06-11
2985 posts
Shadowhand - 21 June 2007 08:13 PM

Don’t forget Forge!

That’s not very “DB -> Form"ish but it does seem quite useful.

 Signature 

————————
Blog | Twitter | GitHub | BitBucket
————————-
PyroCMS - open source modular CMS built with CodeIgniter
PancakeApp - Simple, hosted invoicing/w project management

 
Posted: 21 June 2007 08:57 PM   [ Ignore ]   [ # 6 ]   [ Rating: 0 ]
Avatar
Joined: 2006-07-25
5 posts
danoph - 22 June 2007 12:23 AM

i tried to use forge, put the files in my CI project, and, errors…i’m sure it’s great but annoying when installing something and it doesn’t work.


Parse error: parse error, expecting `T_OLD_FUNCTION’ or `T_FUNCTION’ or `T_VAR’ or `’}’’ in /Users/me/Sites/egci/system/application/libraries/Forge.php on line 32

Forge is PHP5 only.

 
Posted: 23 June 2007 12:56 PM   [ Ignore ]   [ # 7 ]   [ Rating: 0 ]
Joined: 2007-06-23
1 posts

I think I’ve found something you could try and implement…
http://www.phpguru.org/static/TableEditor.html

It’s a class, not an application so you can easily shape it to your means.

PS: Sorry about the late posting, I only just signed up wink

 
Posted: 24 June 2007 07:43 PM   [ Ignore ]   [ # 8 ]   [ Rating: 0 ]
Avatar
Joined: 2007-06-11
2985 posts
rotw - 23 June 2007 04:56 PM

PS: Sorry about the late posting, I only just signed up wink

Its just not good enough, where were you when I needed you most! :(

However I might have to let you off! That is quite some funky shniz right there, thanks for the link!

 Signature 

————————
Blog | Twitter | GitHub | BitBucket
————————-
PyroCMS - open source modular CMS built with CodeIgniter
PancakeApp - Simple, hosted invoicing/w project management

 
Posted: 26 September 2007 12:33 AM   [ Ignore ]   [ # 9 ]   [ Rating: 0 ]
Joined: 2007-05-21
340 posts

I think i’m looking for the same thing, not a full implemented solution but something like

mysql field are ->

name description 
attribute 
varchar
varchar lenght 
:(100

create a view file only with the name of the table :

let use 40 for size by default everywhere maybe an option to control if value is needed or not.

<?=form_input(array('name'=>'description''id'=>'description''maxlength'=>'100''size'=>'40',
                
'value'=>(isset($this->validation) ? $this->validation->description  '')))?> 


Is it for what you’ve looking for ? and have you ever see this around ?

 Signature 

-> None official irc channel [ irc.freenode.net #codeigniter ]

 
Posted: 26 September 2007 06:21 AM   [ Ignore ]   [ # 10 ]   [ Rating: 0 ]
Joined: 2002-05-29
3 posts

While FORGE isn’t quite what you are looking for (it won’t automatically generate any code based on your data model) it is one of the most useful libraries I’ve added to my toolbox recently. I’ve been cranking out applications now that I don’t spend hours writing the same set of forms+validation logic over and over again. I particularly like that FORGE builds on top of the CI libraries & helpers instead of re-implementing everything.

 
Posted: 26 September 2007 11:00 AM   [ Ignore ]   [ # 11 ]   [ Rating: 0 ]
Avatar
Joined: 2007-07-30
2144 posts

I’m not a big fan of Forge, personally. I just dropped a client who’s site was using Forge because it is some of the ugliest, convoluted code, I have seen since using CI. Might not be Forge in general, but this implementation of Forge was simply hideous.

Plus, I didn’t have the time to go and learn all the quirks of the library. I got the basics down, enough to understand what was going on.

I just like more control over my application than what it provides…

The perfect CRUD generator for me, would be merely stating a script and it generating a normal old view with a normal old form, and a normal old controller, with a normal old empty method. grin

 Signature 

Follow me on twitter here.
MichaelWales.com | MichaelWales.info

 
Posted: 26 September 2007 01:38 PM   [ Ignore ]   [ # 12 ]   [ Rating: 0 ]
Joined: 2006-06-17
151 posts

With the risk of sounding like this is self promoting, look again at my Open Source Code Crafter project.

It’s so simple!

- Type in your database login details, and either your table details, or choose to browse the database.
- Select to generated any combination of module-controller-view for any either your database, or a single table.
- Customise your view up to the view level - what label, type of field (checkbox, dropdown, ...) , length etc.
- Choose active record or normal db library queries for your views.
- Generate to disk or screen, or both
- Customise the generated code to your liking.

PLUS, it’s written especially for Code Igniter!

 Signature 

CodeCrafter - Open Source Code Generation for CI