By cloudbull on
Hi all,
when I use theme_table() in D7 got error below
[Wed Feb 16 23:45:45 2011] [error] [client 192.1.8.133]
PHP Fatal error: Unsupported operand types in /......../includes/form.inc on line 993
Here is my code
function theme_print_form(){
drupal_set_message('test table');
$variable = array();
$variable['header'] = array(
array('data' => t('Coupon'), 'field' => 'coupon', 'sort' => 'asc'),
array('data' => t('Type of Discount')),
array('data' => t('Created'), 'field' => 'created'),
array('data' => t('Expire'), 'field' => 'expire'),
array('data' => t('Status'), 'field' => 'used'),
array('data' => t('Used by')),
);
$variable['rows'] = array(
array('a','b','c','d','e','f'),
array('a','b','c','d','e','f'),
);
$variable['attributes'] = array();
return theme_table($variable);
}
What's wrong in my code?
Any help is appreciated.
Keith
Comments
Refer on api.drupal.org
Hello keithyau
You can refer here http://api.drupal.org/api/drupal/includes--theme.inc/function/theme_table/6
Thanks,
The same error
Hi,
I am facing the same problem. Could anybody tell me what is wrong with the code above?
Both codes give me the same errors.
Fatal error: Unsupported operand types in C:\xampp\htdocs\drupal7\includes\form.inc on line 993
Please help
Have you solved this issue? If yes, please tell me how. I have got the same error and unable to solve. Please help.
The error's coming from
The error's coming from form.inc which makes me think you're doing something like this:
Whereas what you need to do is:
Drupal 6
Drupal 7
Hope that helps