我是Drupal新手,尝试创建一个主题功能,为我的视频创建一个小小的iframe。我在我的菜单回调函数中调用该函数。问题是没有调用主题函数。我尝试在主题函数的开始追加模块名称,并且也删除了它,但没有帮助。每次我进行更改,使回溯我devel的模块时清除缓存和我看到下面的警告:Drupal主题功能不叫?
警告:call_user_func_array()预计参数1是一个有效的 回调函数“mymodule_mobile_mymodue_mobile_build_iframe”不 在call_user_func_array()中找到或无效的函数名称( /var/www/includes/theme.inc中的第656行)。 =>
function my_callback_function(){
$output = theme('mymodule_mobile_build_iframe',array(
'arg1'=> $stream,
'arg2'=> $node->nid,)
);
return $output
}
function mymodule_mobile_theme(){
return array(
'mymodule_mobile_build_iframe' => array(
'arguments' => array(
'arg1' => NULL,
'arg2' => NULL,),),);
}
function theme_mymodule_mobile_build_iframe($arg1,$arg2){
$host = 'http://www.myhost.com';
$output = '<video width="320" height="240" controls="controls"> <source src=
"'.$host.'/'.$arg1.'/'.$arg2.'/playlist.m3u8" type="video/mp4" />
Your browser does not support the video tag.
</video>';
return $output;
}
谢谢大家提前!
是的我已经清除了缓存,实际上我已经在devel模块中检查了它是自动的。我不得不提到,我使用的模板文件只包含print $内容,没有条件或任何内容。它怎么说这个功能没有找到? – jax