Php Drupal 7$comment对象枚举

Php Drupal 7$comment对象枚举,php,drupal,Php,Drupal,我需要$comment对象(或其任何实例)的所有成员的列表。产生这个的最好方法是什么?在Drupal源代码中是否有一个定义容易找到的地方(我查看了一下,但没有找到) 类似这样的内容适用于$node对象:(仅在没有说明的情况下)。您可以通过的函数发送$comment: dpm($comment); 您可以通过的函数发送$comment: dpm($comment); 试一试 试试看 获得Firebug的Drupal- -还包含指向Drupal for Firefox Firefox扩

我需要$comment对象(或其任何实例)的所有成员的列表。产生这个的最好方法是什么?在Drupal源代码中是否有一个定义容易找到的地方(我查看了一下,但没有找到)


类似这样的内容适用于$node对象:(仅在没有说明的情况下)。

您可以通过的函数发送$comment:

dpm($comment); 

您可以通过的函数发送$comment:

dpm($comment); 
试一试


试试看


  • 获得Firebug的Drupal- -还包含指向Drupal for Firefox Firefox扩展的链接 与Firebug一起工作。这将节省开支 当你需要的时候,你会感到非常痛苦 转储数据。你只要写 在代码的某个地方
    firp($someVar)
    转储将 以适当的方式显示 萤火虫窗格

  • 转到您的主题,并找到 适当的评论模板- comment.tpl.php(如果您使用 php类型的主题引擎)。这 是你的最佳去处吗 尝试“转储”注释变量- 在顶部壁炉处插入($comment); 这将显示完整的评论 反对

  • 这是Drupal 6安装的转储,Drupal 7可能不同:

    stdClass Object
    (
    [cid] => 1676
    [pid] => 0
    [nid] => 1672
    [subject] => Comment Body
    [comment] =>
    
    Comment Body
    
    
    [format] => 1
    [timestamp] => 1300904186
    [name] => admin
    [mail] =>
    [homepage] =>
    [uid] => 1
    [registered_name] => admin
    [signature] =>
    [signature_format] => 0
    [picture] => sites/default/files/pictures/picture-1.jpg
    [data] => a:7:{s:17:"messaging_default";s:4:"mail";s:6:"preset";s:18:"atrium_user_simple";s:14:"picture_delete";s:0:"";s:14:"picture_upload";s:0:"";s:13:"form_build_id";s:37:"form-5ab3ec10bc31bce9da52e443b0fa0651";s:27:"notifications_send_interval";s:1:"0";s:16:"comment_settings";s:0:"";}
    [thread] => 01/
    [status] => 0
    [messaging_default] => mail
    [preset] => atrium_user_simple
    [picture_delete] =>
    [picture_upload] =>
    [form_build_id] => form-5ab3ec10bc31bce9da52e443b0fa0651
    [notifications_send_interval] => 0
    [comment_settings] =>
    [depth] => 0
    [new] => 0
    )
    
  • 获得Firebug的Drupal- -还包含指向Drupal for Firefox Firefox扩展的链接 与Firebug一起工作。这将节省开支 当你需要的时候,你会感到非常痛苦 转储数据。你只要写 在代码的某个地方
    firp($someVar)
    转储将 以适当的方式显示 萤火虫窗格

  • 转到您的主题,并找到 适当的评论模板- comment.tpl.php(如果您使用 php类型的主题引擎)。这 是你的最佳去处吗 尝试“转储”注释变量- 在顶部壁炉处插入($comment); 这将显示完整的评论 反对

  • 这是Drupal 6安装的转储,Drupal 7可能不同:

    stdClass Object
    (
    [cid] => 1676
    [pid] => 0
    [nid] => 1672
    [subject] => Comment Body
    [comment] =>
    
    Comment Body
    
    
    [format] => 1
    [timestamp] => 1300904186
    [name] => admin
    [mail] =>
    [homepage] =>
    [uid] => 1
    [registered_name] => admin
    [signature] =>
    [signature_format] => 0
    [picture] => sites/default/files/pictures/picture-1.jpg
    [data] => a:7:{s:17:"messaging_default";s:4:"mail";s:6:"preset";s:18:"atrium_user_simple";s:14:"picture_delete";s:0:"";s:14:"picture_upload";s:0:"";s:13:"form_build_id";s:37:"form-5ab3ec10bc31bce9da52e443b0fa0651";s:27:"notifications_send_interval";s:1:"0";s:16:"comment_settings";s:0:"";}
    [thread] => 01/
    [status] => 0
    [messaging_default] => mail
    [preset] => atrium_user_simple
    [picture_delete] =>
    [picture_upload] =>
    [form_build_id] => form-5ab3ec10bc31bce9da52e443b0fa0651
    [notifications_send_interval] => 0
    [comment_settings] =>
    [depth] => 0
    [new] => 0
    )
    

    打印什么($comment)给你?也许这是因为我正在实现hook\u comment\u presave($comment),它还没有它的所有属性?什么是
    print\r($comment)给你?也许这是因为我正在实现hook\u comment\u presave($comment),但它还没有它的所有属性?很好。这可能是我很久以前就应该开始使用的一个模块。打得好。这可能是我很久以前就应该开始使用的模块。