cakePHP, form helper, creating a form automatically - how?

639 Views Asked by At

Is there a way to get form helper to create the inputs of the form (retrieved from db table) by itself?

2

There are 2 best solutions below

0
On BEST ANSWER

The fastest way to create a form:

echo $form->create();
echo $form->inputs();
echo $form->end();
0
On

look at the code cake uses for scaffold, its basically doing a foreach on $Model->schema() and echoing an input for each field. Cake will already pick an input type for the field so the rest is automatic