Use hook_theme()
in your custom module, then call theme()
from your template.
In your module:
mymodule_theme($existing, $type, $theme, $path) { return array( 'my_theme_name' => array( 'template' => 'my_template_file_name',
In your template:
theme('my_theme_name', array('arg1' => 'val1', 'arg2' => 'val2'));
source share