![]() |
Data flow (Controller filters and redirects) - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Data flow (Controller filters and redirects) (/showthread.php?tid=77272) |
Data flow (Controller filters and redirects) - legon614 - 08-10-2020 I have an application where I need to fetch alot of data from MySQL and I do so with my models. I use my models in the BaseControllers construct to be able to use them in all my controllers. I also have a check in my BaseController and if the data I fetch is not what I except I redirect the user to the login page. However, redirects doesn't seem to work from the constructor (I use return redirect()->to(base_url('/account/logged_out')) ![]() I don't see a way of adding arguments to filters if I don't use it from a route adder. I'm trying to figure out a way of getting the database data that is fetched in the BaseControllers construct everywhere. If I could add data to the request object or a memcache or something? How would you approach this? Thanks Tony |