Call to drupal_render() returns NULL
I have been looking since yesterday but can't understand why a call to drupal_render()
is returning NULL
. In my node theme function, when I call drupal_render($element)
wi开发者_如何学JAVAth $element
being defined like below, it renders nothing!
<?php
Array
(
[#type] => textfield
[#title] => Label
[#default_value] =>
[#post] => Array
(
)
[#programmed] =>
[#tree] =>
[#parents] => Array
(
[0] => label
)
[#array_parents] => Array
(
[0] => range
[1] => label
)
[#weight] => 0
[#processed] => 1
[#description] =>
[#attributes] => Array
(
)
[#required] =>
[#input] => 1
[#size] => 60
[#maxlength] => 128
[#autocomplete_path] =>
[#process] => Array
(
[0] => form_expand_ahah
)
[#name] => label
[#id] => edit-label
[#value] =>
[#defaults_loaded] => 1
[#sorted] => 1
[#printed] => 1
)
?>
Any idea what I am missing?
Check drupal source for this function:
if (!isset($elements) || (isset($elements['#access']) && !$elements['#access'])) {
return NULL;
}
You see now how it can return null?
精彩评论