cannot modify header information - headers already sent
Permalink 1 user found helpful
I have a block I'm working on and within the controller.php I have a function that tries to modify the header information... ie...
header("Pragma: public");
header("Content-Type:.... etc etc..
Problem is I keep getting the "cannot modify header information - headers already sent" error message when I call the function...
is there any way round this in C5 ??
header("Pragma: public");
header("Content-Type:.... etc etc..
Problem is I keep getting the "cannot modify header information - headers already sent" error message when I call the function...
is there any way round this in C5 ??
Thanks... I tried that but the error still persists... any other ideas...?
What are you trying to do? Possibly a block controller isn't the right place to be outputting headers. Blocks are really intended to be pieces of content within a page..
cheers.... I think I'm onto a winner with that one...
well... the on_page_view() was indeed the right way to go however it has raised other obstacles lol... so my thanks to you both but jgarcia takes the credit.
Sometimes you need to put JS or CSS file links on the header for a block to work. If it's something you're putting on a block and not on a theme, it's better to output this from the block. Makes it easier to share on the market and works better.
That may work..