You need to write a page callback that calls drupal_get_formseveral times. If the same form editor processes forms, then you need to implement it hook_forms.
function foo_menu() {
$items['foo'] = array(
'page callback' => 'foo_page',
'access arguments' => array('access foo'),
);
return $items;
}
function foo_page() {
for ($i = 0; $i < 10; $i++) {
$build[] = drupal_get_form('foo_form_' . $i, $i);
}
return $build;
}
function foo_forms($form_id, $args) {
if (!empty($args) && $form_id == 'foo_form_' . $args[0]) {
$forms[$form_id]['callback'] = 'foo_form';
}
return $forms;
}
function foo_form($form, $form_state, $i) {
return $form;
}
Of course, if the forms are different, then omit foo_formsand just write foo_form_0, foo_form_1etc. etc.
source
share