1 tabledrag_example.module | tabledrag_example_theme() |
Implements hook_theme().
We need run our forms through custom theme functions in order to build the table structure which is required by tabledrag.js. Before we can use our custom theme functions, we need to implement hook_theme in order to register them with Backdrop.
We are defining our theme hooks with the same name as the form generation function so that Backdrop automatically calls our theming function when the form is displayed.
Related topics
File
- modules/
examples/ tabledrag_example/ tabledrag_example.module, line 56 - Hook implementations for the Tabledrag Example module.
Code
function tabledrag_example_theme() {
return array(
// Theme function for the 'simple' example.
'tabledrag_example_simple_form' => array(
'render element' => 'form',
'file' => 'tabledrag_example_simple_form.inc',
),
// Theme function for the 'parent/child' example.
'tabledrag_example_parent_form' => array(
'render element' => 'form',
'file' => 'tabledrag_example_parent_form.inc',
),
);
}