How to use return redirect() in helper or BaseController - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Best Practices (https://forum.codeigniter.com/forumdisplay.php?fid=12) +--- Thread: How to use return redirect() in helper or BaseController (/showthread.php?tid=83116) |
How to use return redirect() in helper or BaseController - chaudhary sushil - 09-21-2022 redirect() method is working perfectly on the controller but when trying to use it in helper or BaseController, it's not accepting returns. I tried this code but didn't work on both helper and BaseController PHP Code: $session = \Config\Services::session(); PHP Code: if(!($user_data['user']['user_type'] == 1 && $user_data['user']['is_active'] == 1 && $user_data['user']['isLoggedIn'] == 1)){ RE: How to use return redirect() in helper or BaseController - kenjis - 09-22-2022 All you need to know is you must return RedirectResponse object from the controller. redirect() returns RedirectResponse object. |