Redirect from outside a controller |
(05-12-2020, 06:28 AM)imabot Wrote: Is it possible to redirect from outside a controller (from a library to a given URL for example ?). I update this question since I don't have a satisfying answer : A simple example: some pages are restricted to some users, depending on the user rights. I need to load the page data before checking if the current user is allowed to visit the page. Filters are not great because I have to load and process the page data twice (once in the filter and once in the controller). Redirecting from models / libraries / helpers is no longer possible. So it must be done in controllers. The problem is that my controllers becomes more and more complicated. Even worse, I can't split my code into functions, because redirection in CI4 is based on return, so I can't redirect from a private method in my controller or BaseController. Any idea? |
Messages In This Thread |
Redirect from outside a controller - by imabot - 05-12-2020, 06:28 AM
RE: Redirect from outside a controller - by imabot - 05-14-2020, 11:24 PM
RE: Redirect from outside a controller - by kick - 05-15-2020, 11:11 AM
RE: Redirect from outside a controller - by imabot - 05-18-2020, 02:10 AM
RE: Redirect from outside a controller - by dave friend - 05-18-2020, 08:39 AM
|