I have this error:
Dispatcher has detected a cyclic routing causing stability problems
- 0 [internal function]: Phalcon\Mvc\Dispatcher->_throwDispatchException('Dispatcher has ...', 1)
- 1 [internal function]: Phalcon\Dispatcher->_dispatch()
- 2 [internal function]: Phalcon\Dispatcher->dispatch()
- 3 C:\xampp\htdocs\phalcon-test\public\index.php(121): Phalcon\Mvc\Application->handle()
- 4 {main}
So this is what I am trying to do, I would like to create a sub controller under a sub directory. Here's the arrangement of my controllers folder:
controllers
------- Module-one (folder)
------------------ ProductsController.php
ControllerBase.php
On the loader.php I have this code :
$loader->registerDirs( [ $config->application->controllersDir, $config->application->modelsDir ] )->register();
$loader->registerNamespaces(array( // Main 'Controllers' =>'app/controllers/', 'Models' =>'app/models/', // Admin Routing 'Controllers\Module-one'=>'app/controllers/module-one'
))->register();
And for me to call it via Routes, here's my code in my routes.php
$router->add("/module-one", array( 'namespace' => 'Controllers\Module-one', 'controller' => 'products', 'action' => 'index', ));
I am not sure why I am having that error (above)
I just want to put my controller on a sub directory which is being called via routes so that I can arrange the files of the system i'm working on
That happens when I try to visit the url : https://localhost/phalcon-test/module-one
(phalcon-test is the project directory in my htdocs)
Thank you for your help!