I have a typical form that was created using cake/bake.
After the form is submitted, my controller checks a simple condition:
- If condition A is met, it will just save the data using patchEntity($foo, $this->request->getData())
- If condition B is met, a JavaScript warning should be triggered before saving the data.
I would prefer to display the warning using a Bootstrap4 Modal, but I'm not sure how to trigger a modal from within a controller. I understand that this goes against MVC principles, so I am open to alternative suggestions.
The only solution I can think of right now is to redirect to a new action which will then open the modal.