开发者

How to disable the theme output from a Drupal module?

I have a module which list the email address of the newsletter subscribers in website.I want to save thos开发者_StackOverflowe email id as CSV. but the following code gives a header already sent error because i don't know how to disable the theme from the module.

header("Content-Type: application/octet-streamn"); 
header("Content-Disposition:attachment;filename=$file");
readfile($tmpdir.$file);

any suggestions ?


Have you tried using the drupal API for this? See: http://api.drupal.org/api/drupal/includes--common.inc/function/drupal_set_header/6


If you need to output non-themed and/or non-html from Drupal, you will have to do it from a module. In your page handler print your output instead of returning it. See for instance blogapi_rsd().


Make sure to use exit; so that execution will stop and Drupal doesn't get a chance to try and provide it's output.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜