Hi,
I have a problem with routing. I have a plugin but I can not connect a route in a prefix.
Plugins url : /plugin-name/test : call TestController in “pluginsName/TestController.php”
I wan’t
/myprefix/plugin-name/test : call TestController in "pluginsName/TestController.php
My differents test :
<?php
Router::prefix('myprefix', function ($routes) {
// Call TestController in my plugin but in "pluginsName/Api/TestController.php"
$routes->connect('/plugin-name/test', ['plugin' => 'PluginName', 'controller' => 'Test', 'action' => 'display']);
// Error
$routes->connect('/plugin-name/test', ['plugin' => 'PluginName', 'controller' => 'Test', 'action' => 'display', 'prefix'=>false]);
Not work
$routes->plugin('PluginName', function($routes) {
$routes->connect('/test', ['controller' => 'Test', 'action' => 'display']);
});
});
Do you have a solution ?