EllisLab text mark
Advanced Search
     
$this->load->view() vs redirect()
Posted: 04 November 2009 09:24 PM   [ Ignore ]
Joined: 2009-11-02
7 posts

Does anyone know how these two calls/functions differ from one another? As far as I understand it they both perform the same action, only redirect() requires less typing.

 
Posted: 04 November 2009 10:03 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2008-04-19
1152 posts

They are NOT the same.

a redirect redirects you to a different URL.

$this->load->view() loads a view but you should still be in the same URL. This gives you the option to load different views in a method.

 Signature 

PinoyTech - Web Development Blog

 
Posted: 05 November 2009 12:44 AM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2009-10-19
139 posts

i used redirec() to take me to my homepage or wherever i want.

$this->load->view() 

this will load a view plus data from your controller.