开发者

Preprocess functions

I am very new to Drupal and PHP, as I am a .NET dev开发者_JS百科eloper.

I understand the basic concept of hooks. When it comes to preprocess functions you have $var being passed into functions as an argument. How do you know what variables are available in the $var argument?

Also, which preprocess function should I use in the case of a custom view, where I am wanting to add a content to the header portion of the view based on the view's data?


If you want a list of all hooks offered by Views, see http://drupal.org/node/235062 and check the "External Links" section for API documentation of all available views hooks.

If you want to check what is in $var just print_r it to see what's going on in there


PS: an "acceptance rate" of 0% is not a good idea if you want to get future answers


I suggest you install http://drupal.org/project/devel.

Then you can use dpm($something) and it will print it in a nicely formatted, expandable way, which is much easier to read than print_r() or similar functions.

Devel also has tons of other useful features when developing, for example the development blocks which various useful links for clearing caches, rebuilding menus and so on.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜