2010-03-09 59 views
0

我一直在寻找自从昨天,但不明白为什么呼叫drupal_render()返回NULL。在我的节点主题功能中,当我调用drupal_render($element)$element被定义如下时,它不会呈现任何内容!调用drupal_render()返回NULL

<?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

检查的Drupal来源:

if (!isset($elements) || (isset($elements['#access']) && !$elements['#access'])) { 
    return NULL; 
    } 

现在你看到它是如何可以返回空值?