2010-03-09 102 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; 
    } 

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