EllisLab text mark
Advanced Search
$this->load->view() vs redirect()
Posted: 04 November 2009 08:24 PM
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 09:03 PM   [ # 1 ]   [ Rating: 0 ]
Joined: 2008-04-19
1153 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.


Thorpe Obazee

Posted: 04 November 2009 11:44 PM   [ # 2 ]   [ Rating: 0 ]
Joined: 2009-10-19
139 posts

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


this will load a view plus data from your controller.