小编Tom*_*Tom的帖子

从菜单回调函数返回drupal中的untemplated输出

我有一个drupal模块,其函数返回附件text/plain,

function mymodule_menu() {
$items = array();
$items[MY_PATH] = array(
'title' => 'some page',
'page callback' => 'myfunction',
'type' => MENU_CALLBACK,
);
}

function myfunction()
{
drupal_set_header('Content-Type: text/plain');
return "some text";
}
Run Code Online (Sandbox Code Playgroud)

但它返回page.tpl.php模板中的页面,但是我希望它没有模板化,我如何覆盖主题以使其返回纯文本?

谢谢,

汤姆

drupal drupal-6

8
推荐指数
3
解决办法
5402
查看次数

标签 统计

drupal ×1

drupal-6 ×1