Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Error - Dispatcher has detected a cyclic routing causing stability problems

How this error comes (Dispatcher has detected a cyclic routing causing stability problems)? I'm making forward to another controller action.



83.0k
Accepted
answer

If the dispatch loop makes more than 256 loops it throws this exception. Normally this is caused because the application continue making forwards over and over without exiting the dispatch loop. https://github.com/phalcon/cphalcon/blob/2.0.0/phalcon/dispatcher.zep#L378

So on forward, the dispatcher will fire the events again for listeners, thats what I noted since I put my forward inside beforeExecuteRoute function.

Thank you for help it works now:

<?php if($this->dispatcher->getControllerName() != 'forward_controller') // .. ?>



503

i am also gettin same error "Dispatcher has detected a cyclic routing causing stability problems"