Not sure to migrate to CI4 |
(05-18-2020, 02:09 AM)imabot Wrote:Quote:And what about throwing an exception? If you encounter any problem in your model, throw an exception, the controller catch it and redirect with the error message. Yes. You can even create custom exception. But if you want to keep it simple, just throw new Exception(“Your custom error message...”); and in your controller catch the exception, get the message from the Exception object and redirect with that message.
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/ |
Welcome Guest, Not a member yet? Register Sign In |