Ok so I am writing a custom module and am trying to undestand how Drupal manages theming output.
I have registered my theme function, ie
mymodule_theme() {
return array(
'mylist' => 'templates/mylist-template',
'arguments' => array('data'=>NULL)
);
}
The mylist-template contains a HTML table with a heading row, such as:
<table>
<tr>
<td>ID</td>
<td>Name</td>
</tr>
<?php print $rows; ?>
</table>
As you can see here I want to output x number of rows using another template file such as list-rows.tpl.php, ie:
<tr>
<td>1</td>
<td>My Name</td>
</tr>
How do I achieve this? At the moment I have a menu item with my table function, let's say:
function mymodule_table() {
$output = theme('list','');
return $output;
}
This works fine but im not sure how I would implement my rows