From 1fa1a9c0b01515220e4bb1b3844aaad1bd759b9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20Mat=C4=9Bj=C4=8Dek?= Date: Mon, 1 Feb 2016 12:47:59 +0100 Subject: [PATCH] Interface IRouteMeta define API for RoutingPanel. --- src/Application/IRouteMeta.php | 29 +++++++++++++++++++ src/Application/Routers/Route.php | 2 +- src/Application/Routers/SimpleRouter.php | 11 ++++++- src/Bridges/ApplicationTracy/RoutingPanel.php | 5 ++-- 4 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 src/Application/IRouteMeta.php diff --git a/src/Application/IRouteMeta.php b/src/Application/IRouteMeta.php new file mode 100644 index 000000000..09ee5a925 --- /dev/null +++ b/src/Application/IRouteMeta.php @@ -0,0 +1,29 @@ +flags; } + /** + * Info how url looks like. + * @return string + */ + public function getMask() + { + return '?presenter=[&action=]'; + } + } diff --git a/src/Bridges/ApplicationTracy/RoutingPanel.php b/src/Bridges/ApplicationTracy/RoutingPanel.php index e042cc9ea..dd78dca07 100644 --- a/src/Bridges/ApplicationTracy/RoutingPanel.php +++ b/src/Bridges/ApplicationTracy/RoutingPanel.php @@ -8,6 +8,7 @@ namespace Nette\Bridges\ApplicationTracy; use Nette; +use Nette\Application; use Nette\Application\Routers; use Nette\Application\UI\Presenter; use Tracy; @@ -119,8 +120,8 @@ private function analyse($router, $module = '') $this->routers[] = [ 'matched' => $matched, 'class' => get_class($router), - 'defaults' => $router instanceof Routers\Route || $router instanceof Routers\SimpleRouter ? $router->getDefaults() : [], - 'mask' => $router instanceof Routers\Route ? $router->getMask() : NULL, + 'defaults' => $router instanceof Application\IRouteMeta ? $router->getDefaults() : [], + 'mask' => $router instanceof Application\IRouteMeta ? $router->getMask() : NULL, 'request' => $request, 'module' => rtrim($module, ':'), ];