EllisLab text mark
Advanced Search
     
When is appropriate to use Redirect?
Posted: 20 November 2012 03:06 AM   [ Ignore ]
Joined: 2012-08-23
4 posts

When is it correct practice to use Redirect instead of a simple load->view?

The reason I ask is because in the ion_auth demo, there is a comment that states:
“use redirects instead of loading views for compatibility with MY_Controller libraries”

I admit I don’t fully understand this statement. If I extend someone else’s class library, does that mean that forever after, I use redirect?

Thanks.

 
Posted: 21 November 2012 03:31 AM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2009-07-26
818 posts

You can still load views. The reason I did it that way is because most MY_Controllers automatically build data and load views based on the URL, by redirecting you can take advantage of that instead of writing it twice.  It seemed like the simplest, most compatible way to handle it for generic use.

For most of my own apps I will jut call the controller method instead of redirecting.

 Signature 

BenEdmunds.com

Contact Me:                                    My Code: 

  ben.edmunds@gmail.com            Github
  @benedmunds