Is it possible to define panel routes inside a plugin file?

The problem isn’t that there’s another route that matches the URI. The problem is that you never tell your router to do its thing. :smiley:

You need the following code to process the router’s routes and call an appropriate one:

// Get the appropriate route from the Router
$route = $router->run(kirby()->path());

// Return if we didn't define a matching route to allow Kirby's router to process the request
if(is_null($route)) return;

// Call the route
$response = call($route->action(), $route->arguments());

// $response is the return value of the route's action, but we won't need that
// Exit execution to stop Kirby from displaying the error page
exit;
1 Like