开发者

Drupal - Displaying page / form variables for node add/edit and comments

How can I print the variables of Drupal's node add/edit and comment forms?

I've tried print_r($form); It returns NULL.

Here's my module:


function comment_mod_form_alter(&$form, $form_state, $form_id) {
  if (i开发者_JS百科n_array($form_id, array('comment_form'))) {
        unset($form['homepage']); // this works
    print_r($form);
  } 
}


Are you implementing the hook_form_alter(&$form, &$form_state, $form_id) function in your module? This will be called for all forms, so if you add your calls and visit the node add/edit page you should see some output. From what you've said I don't see why it wouldn't.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜