我有一个drupal模块,其功能是返回附件文本/纯文本,

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


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

谢谢,

汤姆

最佳答案

这将返回纯文本

function myfunction() {
  drupal_set_header('Content-Type: text/plain');
  print "some text";
  exit(0);
}

07-24 17:59
查看更多