I've a piece of code what is rendering a custom table (see var_dump below) what is shown on for specific states of the node. The data of the table is for both states the same.
array(1) {
[0]=>
array(5) {
["#theme"]=>
string(5) "table"
["#header"]=>
array(2) {
[0]=>
string(4) "test"
[1]=>
string(9) "geen test"
}
["#rows"]=>
array(2) {
[0]=>
array(2) {
[1]=>
string(6) "e1a1r1"
[2]=>
string(6) "e1a2r1"
}
[1]=>
array(2) {
[1]=>
string(6) "e1a1r2"
[2]=>
string(6) "e1a2r2"
}
}
["#prefix"]=>
string(38) "<h3>Table</h3>"
["#attributes"]=>
array(1) {
["class"]=>
array(1) {
[0]=>
string(15) "previous-scheme"
}
}
}
}
The custom states of the node are determined by a condition what prints one of the following gathered variables.
For the variable at the line below works with both drupal_render and render.
$kickoff_deadline .= '<h2>Between kickoff and deadline</h2>'.drupal_render($table);
For the variable at the line below only works with render, without it wont show anything.
$after_deadline .= '<h2>After the deadline</h2>'.render($table);
So what is happening? Why doesn't drupal_render work for a similar printed variable what does work?