plesk / plesk-ext-sdk

Toolkit for development extensions for Plesk
Apache License 2.0
11 stars 7 forks source link

Incorrect Zend routes generated if same component used in different routes #16

Closed mdsina closed 5 years ago

mdsina commented 5 years ago

Plesk version: 17.9.5 plesk-ext-sdk: 0.4.0 Actual result: Routing doesn't work, Zend failed Expected result: Routes generated in different way

Additional info:

example extension.config.js:

module.exports = {
    routes: [
        {
            path: '/settings',
            component: 'domain/RemoteAccess',
            title: 'Settings',
        },
        {
            path: '/access',
            component: 'domain/RemoteAccess',
            title: 'Remote Access',
        },
    ],
};

from index.php:

$router->addConfig(new \Zend_Config([
    'Default' => [
        'route' => ':controller/:action',
    ],

    'domain/RemoteAccess' => [
        'route' => '/settings',
        'defaults' => ['controller' => 'index', 'action' => 'view'],
    ],

    'domain/RemoteAccess' => [
        'route' => '/access',
        'defaults' => ['controller' => 'index', 'action' => 'view'],
    ],

]));