Hey people! I must've misunderstood something, but I've added the following for my routing:
$di->set('router', function() {
new Router();
$router->setDefaultNamespace('\Customer\Controllers');
// Add index route.
$router->add(
"/",
array(
"controller" => "index",
"action" => "index"
)
);
// Set up error routing.
$router->notFound(
array(
"controller" => "Error",
"action" => "notFound"
)
);
$router->handle();
return $router;
});
And when I request /ndosnd
, the Router::wasMatched() returns true
with Router::getMatches() being the following:
array (size=2)
0 => string '/ndosnd' (length=5)
1 => string 'ndosnd' (length=4)
I expected this match to fail and go to the ErrorController::notFoundAction(). What's going on?
Thanks for your time.
// dimhoLt