Welcome Guest, Not a member yet? Register   Sign In
Unable to change content-type!?
#1

[eluser]Unknown[/eluser]
I'm using codeigniter 1.7.3
In my controller

function Test()
{
parent::Controller();

$this->output->set_header('Content-Type:application/xml');
//$this->output->set_content_type('application/xml');
}

I tried both set_header & set_content_type it still return text/html.
How could i fix this?

#2

[eluser]xtremer360[/eluser]
parent::Controller() should first be in your construct function now in a separate function such as this. Also where are you calling the Test function.
#3

[eluser]CroNiX[/eluser]
Test() is his construct, assuming the classname is also Test. Naming a method name after the classname is just an older way of doing constructs before the __construct() magic method was introduced.
#4

[eluser]Unknown[/eluser]
That's right

class Test extends Controller {

function Test()
{


So back to the problem, any idea why content-type can't be change in my case?
Thanks.




Theme © iAndrew 2016 - Forum software by © MyBB