Able to see a variable in print_r()'s output, but not sure how to access it in code

后端 未结 9 852

I googled, installed Devel, Drupal for Firebug, but I can\'t find it.

I found what I want, I know where it is; I just don\'t know how to g

9条回答
  •  生来不讨喜
    2020-11-22 02:51

    Let's say you have a node object in $node. You can print it's values very nice with:

    dpm($node); // remember this function is declared in devel module
    

    Then you can see the information from $node and expand the internal fields with a click. And with a double click on the field you can see it's php path.

    Devel Information of a Drupal node object

    You'll get this result:

    Devel showing the path after double clicking a field

    Hope that helps!

    PD: I guess this functionality isn't available on D6's dpm.

提交回复
热议问题