CodeIgniter Forums
Exiting the application - simple issue - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Exiting the application - simple issue (/showthread.php?tid=9300)

Pages: 1 2


Exiting the application - simple issue - El Forum - 06-20-2008

[eluser]Rick Jolly[/eluser]
[quote author="arume" date="1214008994"][quote author="Rick Jolly" date="1214005320"]It won't work because of CI's output buffering.[/quote]

I am using it and, as far as I know, it works. Can you say me where is the error?
Thanks.[/quote]
Sorry arume, I was referring to EEssam's code.


Exiting the application - simple issue - El Forum - 06-21-2008

[eluser]treehousetim[/eluser]
Just for reference,

Another way to accomplish this is to have a controller that you redirect to in this instance.
Then in that controller, display the view you want.


Exiting the application - simple issue - El Forum - 06-21-2008

[eluser]EEssam[/eluser]
Hi treehousetim,

Can you please clarify with some code.


Exiting the application - simple issue - El Forum - 06-21-2008

[eluser]treehousetim[/eluser]
Code:
if (1 == 1)
{
    redirect( '/Closed' );
}

then in controllers/Closed.php

Code:
class Closed extends Controller
{
    function index()
    {
        $this->load->view( ’closed’, $this->data );
    }
}



Exiting the application - simple issue - El Forum - 06-21-2008

[eluser]EEssam[/eluser]
That's cool! Thanks.


Exiting the application - simple issue - El Forum - 06-22-2008

[eluser]Seppo[/eluser]
This seems to be fixed, but I add my opinion
Code:
if (...)
{
    $this->load->view(’closed’, $this->data);
    return; //exit;
}
With return the controller script is halted, but the rest of CI still works as it should.

-Edit- now I see ontguy already posted it. Sorry then.