You are here

function dbtng_example_convert_resultset_to_table_render_array in Examples for Developers 7

This function renders array for table 'dbtng_example'

Related topics

1 call to dbtng_example_convert_resultset_to_table_render_array()
dbtng_example_render_resultset_as_table in dbtng_example/dbtng_example.module
This function renders a resultset as table

File

dbtng_example/dbtng_example.module, line 672
This is an example outlining how a module can make use of the new DBTNG database API in Drupal 7.

Code

function dbtng_example_convert_resultset_to_table_render_array($rows = array()) {
  $header = array(
    t('Name'),
    t('Count'),
  );
  $output = theme('table', array(
    'header' => $header,
    'rows' => $rows,
    'empty' => t('No records found'),
  ));
  return $output;
}