Skip to content

Commit

Permalink
Use route defaults instead of substr on route name.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Aug 11, 2019
1 parent c6e0fcb commit 258e17e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Panel/RoutesPanel.php
Expand Up @@ -37,7 +37,7 @@ public function summary()
}

$routes = array_filter(Router::routes(), function ($route) {
return strpos($route->getName(), 'debugkit.') !== 0;
return $route->defaults['plugin'] === 'DebugKit';
});

return count($routes);
Expand Down
2 changes: 1 addition & 1 deletion src/Template/Element/routes_panel.ctp
Expand Up @@ -21,7 +21,7 @@ $routes = Cake\Routing\Router::routes();
$class = '';
if ($matchedRoute === $route->template):
$class = 'highlighted';
elseif (strpos($route->getName(), 'debugkit.') === 0):
elseif ($route->defaults['plugin'] === 'DebugKit'):
$class = 'debugkit-route hidden';
endif;
?>
Expand Down

0 comments on commit 258e17e

Please sign in to comment.