Okay... this depends on what type of form you need to create, and what you consider "easy".
The "easiest" way to do this might be to create a relationship with all of the appropriate fields. Then you can use the df_create_new_related_record_form() function which generates a Dataface_ShortRelatedRecordForm object which is the same form used when adding new records in a relationship.
You can make it so that this relationship does not show up in your tabs by setting the action:visible property of the relationship to 0.
e.g.:
- Code: Select all
$profile =& df_get_record('Profiles',array('id'=>10));
$form =& df_create_new_related_record_form($profile, 'Publications');
if ( $form->validate() ){
$res = $form->process(array(&$form, 'save'), true);
if ( PEAR::isError($res) ) {
// There was an error in processing... do something.
} else {
// It was successful.. forward to a success page.
}
}
$form->display();