Before filters with main page redirect when I call a controller with ajax |
(11-24-2022, 11:37 AM)ozornick Wrote: Do you want an unauthorized user to be redirected to the main page when requesting Ajax? Let me explain, I'm migrating a big application from CI3 to CI4, I'm practically done, I'm trying to fix some things that can still be improved with the new features of CI4. One of these are filters and the use of before and after. I already have the same control managed by javascript, but I wanted to take advantage of the filters also avoiding extra http calls. The behavior must exist both on "normal" calls, and in ajax calls. If there's no way to tell php/CI to redirect the entire page and not just the ajax-handled portion, I'll stick with the current pure javascript version. Passing a parameter would also be feasible, but some calls only return html and it would be problematic to modify the whole structure, thanks anyway for the advice, but at this point I think I'll stay with the javascript version |
Messages In This Thread |
Before filters with main page redirect when I call a controller with ajax - by serialkiller - 11-23-2022, 03:28 AM
RE: Before filters with main page redirect when I call a controller with ajax - by motoroller - 11-23-2022, 02:23 PM
RE: Before filters with main page redirect when I call a controller with ajax - by serialkiller - 11-24-2022, 01:26 AM
RE: Before filters with main page redirect when I call a controller with ajax - by ozornick - 11-24-2022, 06:53 AM
RE: Before filters with main page redirect when I call a controller with ajax - by serialkiller - 11-24-2022, 07:04 AM
RE: Before filters with main page redirect when I call a controller with ajax - by ozornick - 11-24-2022, 11:37 AM
RE: Before filters with main page redirect when I call a controller with ajax - by serialkiller - 11-25-2022, 01:56 AM
|