I tend to just call them... There's no real reason to rename it is there?
$items[] = array('path'=>'foo', 'callback' => 'mymodule_foo $items[] = array('path'=>'foo2', 'callback' => 'mymodule_foo2 function mymodule_foo() { .... some code.... $output .= drupal_get_from('mymodule_myform1'); return $output; }
function mymodle_foo2() { .... some different code ... $output .= drupal_get_form('mymodule_myform1'); return $output; }
Or are you talking aobut some other type of reuse? Am I missing something here?
Dave
-----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Ivan Sergio Borgonovo Sent: Tuesday, January 29, 2008 8:21 AM To: support@drupal.org Subject: [support] hook_forms and theming
Is there a smarter way to recycle the same form and same themeing function other than hook_forms + aliasing the theme function:
function mymodule_forms() { $forms['mymodule_myform2']=Array( 'callback'=> 'mymodule_myform1', ); return $form; }
function theme_mymodule_myform2($form) { return theme_mymodule_myform1($form); }