diff --git a/plugins/Tags/config/routes.php b/plugins/Tags/config/routes.php index 93223e1..f4a1620 100644 --- a/plugins/Tags/config/routes.php +++ b/plugins/Tags/config/routes.php @@ -13,6 +13,22 @@ $routes->plugin( ['controller' => 'Tags'] ); + $routes->get('/', ['controller' => 'Tags', 'action' => 'index']); + // $routes->get('/{id}', ['controller' => 'Tags', 'action' => 'view']); + // $routes->put('/{id}', ['controller' => 'Tags', 'action' => 'edit']); + } +); +$routes->plugin( + 'Tags', + ['path' => '/Tags'], + function ($routes) { + $routes->setRouteClass(DashedRoute::class); + + $routes->connect( + '/{action}/*', + ['controller' => 'Tags'] + ); + $routes->get('/', ['controller' => 'Tags', 'action' => 'index']); // $routes->get('/{id}', ['controller' => 'Tags', 'action' => 'view']); // $routes->put('/{id}', ['controller' => 'Tags', 'action' => 'edit']); diff --git a/src/Controller/Component/NavigationComponent.php b/src/Controller/Component/NavigationComponent.php index 8798531..aa6f466 100644 --- a/src/Controller/Component/NavigationComponent.php +++ b/src/Controller/Component/NavigationComponent.php @@ -26,6 +26,7 @@ class NavigationComponent extends Component 'MetaTemplates' => 'object-group', 'LocalTools' => 'tools', 'Instance' => 'server', + 'Tags' => 'tags', ]; public function initialize(array $config): void @@ -112,7 +113,12 @@ class NavigationComponent extends Component 'label' => __('Local Tools'), 'icon' => $this->iconToTableMapping['LocalTools'], 'url' => '/localTools/index', - ] + ], + 'Tags.index' => [ + 'label' => __('Tags'), + 'icon' => $this->iconToTableMapping['Tags'], + 'url' => '/tags/index', + ], ] ], 'LocalTools' => [ @@ -364,6 +370,9 @@ class NavigationComponent extends Component ], ] ]), + 'Tags' => $this->getDefaultCRUDConfig('Tags', [ + 'defaults' => ['depth-1' => ['textGetter' => 'label']] + ]), 'LocalTools' => [ 'routes' => [ 'LocalTools:index' => [ diff --git a/templates/element/layouts/header/header-profile.php b/templates/element/layouts/header/header-profile.php index e09f1e6..1fd7414 100644 --- a/templates/element/layouts/header/header-profile.php +++ b/templates/element/layouts/header/header-profile.php @@ -7,16 +7,16 @@ use Cake\Routing\Router;