我从昨天开始一直在寻找,但无法理解为什么拨打drupal_render()
的电话会回复NULL
。在我的节点主题函数中,当我调用drupal_render($element)
时$element
的定义如下所示,它什么都没有呈现!
<?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
)
?>
知道我缺少什么吗?
答案 0 :(得分:0)
检查此函数的drupal源:
if (!isset($elements) || (isset($elements['#access']) && !$elements['#access'])) {
return NULL;
}
你现在看到它如何返回null?