Welcome Guest, Not a member yet? Register   Sign In
Possible issue with router->controllerName()
#2

Nobody has picked up on this so I have investigated further.

I have noticed that my "before" filter is called twice on an initial page load when hot load is enabled. I don't know why this is. On the one call the controllerName() function returns the correct string, but on the other call it returns a Closure object which is what is breaking my code.

I've modified my code so that my "before" filter simply returns if this condition is false:

PHP Code:
$controllerName $router->controllerName();
if (!
is_string($controllerName)) {
    log_message('debug''skipping before filter');
    return;            


This seems to have fixed the problem without compromising what the filter is doing.
Reply


Messages In This Thread
RE: Possible issue with router->controllerName() - by Fido L Dido - 01-09-2025, 07:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB