2012-03-21 18 views

Odpowiedz

8

Zastosowanie hook_theme() w module niestandardowej, a następnie wywołać metodę theme() od wewnątrz szablonu.

w module:

mymodule_theme($existing, $type, $theme, $path) { 
    return array(
    'my_theme_name' => array(
     'template' => 'my_template_file_name', // without the .tpl.php extension 
     'variables' => array(), // to define default values for passed variables 
    ) 
); 
} 

W szablonie:

theme('my_theme_name', array('arg1' => 'val1', 'arg2' => 'val2')); 
Powiązane problemy