There are cases like components that do some kind of CRUD and intercept controller actions. Right now there is no proper way to stop the controller from not throwing the MissingActionException.
Inside https://github.com/burzum/cakephp-user-tools/blob/develop/src/Controller/Component/UserToolComponent.php I'm calling this code:
$this->Controller->response->send();
exit;
The issue with that is any other dispatcher filters and probably components as well are not executed. After a good amount of time I figured out that this was the cause for debug kit not showing up on these "CRUD" pages. Removing the exit results in redering the content two times, so this isn't an option either.
I've already talked with Jose about this, he suggested to add something to allow the user of the framework to define fallback objects or callables instead of directly throwing the exception. An alternative I suggested would be a way to disable this exception, public property or a method, so that I can disable it from inside my component. Adding Controller::_stop() back and bypass the exception somehow through it might be another option?
As this works right now I don't think there is a way that would allow me to completely intercept a controller action from a component because of it.
The only way to deal with this is to override Controller::invoceAction() which is not really an option IMHO because it defeats the idea of the component. I think components should be able to do whatever they want with the controller.
There are cases like components that do some kind of CRUD and intercept controller actions. Right now there is no proper way to stop the controller from not throwing the MissingActionException.
Inside https://github.com/burzum/cakephp-user-tools/blob/develop/src/Controller/Component/UserToolComponent.php I'm calling this code:
The issue with that is any other dispatcher filters and probably components as well are not executed. After a good amount of time I figured out that this was the cause for debug kit not showing up on these "CRUD" pages. Removing the exit results in redering the content two times, so this isn't an option either.
I've already talked with Jose about this, he suggested to add something to allow the user of the framework to define fallback objects or callables instead of directly throwing the exception. An alternative I suggested would be a way to disable this exception, public property or a method, so that I can disable it from inside my component. Adding Controller::_stop() back and bypass the exception somehow through it might be another option?
As this works right now I don't think there is a way that would allow me to completely intercept a controller action from a component because of it.
The only way to deal with this is to override Controller::invoceAction() which is not really an option IMHO because it defeats the idea of the component. I think components should be able to do whatever they want with the controller.