CodeIgniter Forums

Full Version: Automated Form Generation
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2

El Forum

[eluser]Phil Sturgeon[/eluser]
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

El Forum

[eluser]Crimp[/eluser]
I'll make the button. ;-)

El Forum

[eluser]Shadowhand[/eluser]
Don't forget Forge!

El Forum

[eluser]Crafter[/eluser]
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.

El Forum

[eluser]danoph[/eluser]
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

El Forum

[eluser]Phil Sturgeon[/eluser]
[quote author="Shadowhand" date="1182471197"]Don't forget Forge![/quote]

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

El Forum

[eluser]Shadowhand[/eluser]
[quote author="danoph" date="1182486236"]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[/quote]

Forge is PHP5 only.

El Forum

[eluser]Unknown[/eluser]
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

El Forum

[eluser]Phil Sturgeon[/eluser]
[quote author="rotw" date="1182632166"]PS: Sorry about the late posting, I only just signed up Wink[/quote]

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

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

El Forum

[eluser]sikkle[/eluser]
I think i'm looking for the same thing, not a full implemented solution but something like

mysql field are ->

Code:
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.

Code:
<?=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 ?
Pages: 1 2