getting the full $form in 5.x
Maybe I'm missing something obvious, but is there a simple way in Drupal 5.x to get the full form corresponding to a particular form ID? Specifically, I want to have the $form with all the elements added via hook_form_alter, but without rendering the $form. Looks like I might have to do it in 2 steps: $form = drupal_retrieve_form('myformid') foreach (module_implements('form_alter') as $module) { $function = $module .'_form_alter'; $function('myformid', $form); } Thanks, Peter
Drupal 5.x to get the full form corresponding to a particular form ID? Specifically, I want to have the $form with all the elements added via hook_form_alter, but without rendering the $form.
If this is what you want then indeed you need two steps. As you have not outlined what do you want to do with the form, I can't really guess a better way. Maybe you want to do $form = drupal_retrieve_form($form_id); drupal_prepare_form($form_id, $form); or even drupal_process_form($form_id, $form); Eaton did a very good job in slicing up the form workflow steps into separate functions -- but if you want half of a step, then you indeed need do it for yourself.
participants (2)
-
Karoly Negyesi -
Peter Wolanin