[support] hook_forms and theming

Metzler, David metzlerd at evergreen.edu
Tue Jan 29 17:19:38 UTC 2008


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 at drupal.org [mailto:support-bounces at drupal.org] On
Behalf Of Ivan Sergio Borgonovo
Sent: Tuesday, January 29, 2008 8:21 AM
To: support at 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);
}


-- 
Ivan Sergio Borgonovo
http://www.webthatworks.it

-- 
[ Drupal support list | http://lists.drupal.org/ ]


More information about the support mailing list