2012-03-21 23 views

risposta

8

Usa hook_theme() in un modulo personalizzato, quindi chiamare il metodo theme() all'interno del tuo modello.

Nel modulo:

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 
    ) 
); 
} 

Nel modello:

theme('my_theme_name', array('arg1' => 'val1', 'arg2' => 'val2')); 
Problemi correlati