Welcome Guest, Not a member yet? Register   Sign In
Novice question about Output class
#1

[eluser]Unknown[/eluser]
Hi,

I am a novice in CI and i have questions about some solutions, the first is:

I have a function like this in my controller:

Code:
function testAjax()
{
    $this->output->set_header('Content-type: text/xml');
    $this->output->set_output('&lt;?xml version="1.0" encoding="ISO-8859-1" ?&gt;<root>content</root>';
}

but i know i can do somethink like that:
Code:
function testAjax()
{
    header('Content-type: text/xml');
    echo '&lt;?xml version="1.0" encoding="ISO-8859-1" ?&gt;<root>content</root>';
}

the second solution use only php core functions.

Do you agree that the second solution is better (faster, portable)?
Is there any motive to use first solution?


Messages In This Thread
Novice question about Output class - by El Forum - 01-31-2008, 01:04 PM
Novice question about Output class - by El Forum - 01-31-2008, 02:34 PM



Theme © iAndrew 2016 - Forum software by © MyBB