Redirect from BaseController |
Hey gang, I am trying to redirect from my BaseController with a function called by the child Controller but it doesn't seem to work. Here is what I have.
BaseController.php PHP Code: class BaseController extends Controller ChildController.php PHP Code: class ChildController extends BaseController To answer the question: Yes, the session variable 'something' has not been created and empty($this->session->get('something')) returns true; Any help greatly appreciated. Thank you!
You should look into controller filters for this type of a situation.
(11-12-2021, 11:10 AM)kilishan Wrote: You should look into controller filters for this type of a situation. BINGO! Thanks!
redirect() is the most changed helper function.
3.x https://codeigniter.com/userguide3/helpe...l#redirect 4.x https://codeigniter.com/user_guide/gener...l#redirect In CI4, it returns RedirectResponse, and you must return it. |
Welcome Guest, Not a member yet? Register Sign In |