Something that I ran across from updating CakePHP v1.1 to CakePHP v1.2
Beta for forms is that quite a few things changed and I wanted to
continue to show all of the fields the database has as they are added
without having to modify my views or controllers.

For the View:
 - Form::generateFields was renamed to Form::inputs with some nice
additions to it.
 - Html::submit was moved to Form::submit.

For Controllers:
 - Controller::generateFieldNames was removed completely. This is no
longer "needed" as Form::inputs function will check the database and
build the variables that is required to create the form if they are
missing.

So now all you need is the list of fields that
Controller::generateFieldNames to be sent to the view like it used to
have. You can get a list of the field names by using either
Model::getColumnTypes or Model::schema to get the key values set into
an array to be sent to Form::inputs in the view.

You'll want to have the format something like this:

$fields = array(
   'id' => array(),
   'name' => array()
);

Another thing to note, is that Form::inputs will create the fieldset
and legend fields for you so you no longer have to create them
yourselves (if you did). You can set the text for the legend by having
the key value of "legend" to the list of your field names.

I hope this helps some people out. If someone has found a better way
to do this please let me know!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to