function theme_test($form) {
$output = '';
foreach($form['field'] as $key => $val){
$output .= '<div class="test">';
$output .= drupal_render($val['uid'. $key]);
$output .= '</div>';
unset($key,$val);
}
return $output;
}
When I run this code, I get the following warning message:
Warning: Cannot use a scalar value as an array in theme_test()
How do I resolve this, and what is the reason behind this warning?
$val
to be an array. As it is, it's more a question about PHP, and not a question specific for Drupal. The meaning of the warning doesn't change, in Drupal.