I want to create this kind of architecture:
* Controllers
* Tracking
* Instagram
* Twitter
* Export
* Instagram
* Twitter
For example, I wanted to create the route /tracking/instagram/create
In routes.php, i added:
Router::prefix('tracking', function (RouteBuilder $routes) {
\Router::scope('/instagram', function (RouteBuilder $routes) {
$routes->connect('/create', ['controller' => 'Instagram', 'action' => 'create']);
});
});
And I created the file src\Controller\Tracking\InstagramController.php with the namespace App\Controller\Tracking
and the public function create()
Unfortunately I still have an :
Error: A route matching "/tracking/instagram/create" could not be found.
Thanks in advance for your help.
Are you try just put this?
Router::prefix('tracking', function (RouteBuilder $routes) {
$routes->connect('/:controller/:action/*',[], ['routeClass' => 'DashedRoute']);
});