开发者

single hook_form for many form ids

开发者 https://www.devze.com 2023-02-07 03:14 出处:网络
in my module i am creating a page with many simple forms: foreach ($parameters as $param){ $output = drupal_get_form(\'mymodule_param_\'.$param[\'id\'].\'_form\', $product);

in my module i am creating a page with many simple forms:

foreach ($parameters as $param){
  $output = drupal_get_form('mymodule_param_'.$param['id'].'_form', $product);
}
print $output;

i need to find a way to implement a single mymodule_param_form functio开发者_开发知识库n (and the _validate , _submit ) that will apply on each $param['id'] in my $params array. i trust drupal to allow such behavior. just didnt find it yet. any help ?


You practically posted your own answer: hook_forms

0

精彩评论

暂无评论...
验证码 换一张
取 消