语法错误,意外';{';php drupal模块

语法错误,意外';{';php drupal模块,php,drupal,drupal-7,Php,Drupal,Drupal 7,我想不出有什么问题。:/您遗漏了函数声明: Parse error: syntax error, unexpected '{' in C:\xampp\htdocs\atins\drupal\sites\all\modules\my_module\my_module.module on line 3 my_module_form_alter(&$form, $form_state, $form_id){ if($form_id == "webform-client-form-57

我想不出有什么问题。:/

您遗漏了
函数
声明:

Parse error: syntax error, unexpected '{' in C:\xampp\htdocs\atins\drupal\sites\all\modules\my_module\my_module.module on line 3

my_module_form_alter(&$form, $form_state, $form_id){ 
  if($form_id == "webform-client-form-57--3"){ 
    $form["webform-component-email-address"]["#default_value"] = "BLAH BLAH";
  }
}

另一个小提示,您应该通过引用(
&$form\u state
)传入
$form\u state
),以防您计划在钩子中使用它(请参阅).

在您的…函数前面缺少
函数
关键字。

您需要在函数名称前面有
函数
关键字

在所有这些前面缺少一个
函数
function my_module_form_alter(&$form, $form_state, $form_id){ 
  if($form_id == "webform-client-form-57--3"){ 
    $form["webform-component-email-address"]["#default_value"] = "BLAH BLAH";
  }  
}