I'd like to create a new exception, called SecurityException. Where should I put the code?
class SecurityException extends CakeException {};
Thanks!
I'd like to create a new exception, called SecurityException. Where should I put the code?
class SecurityException extends CakeException {};
Thanks!
I followed luchomolina's 2nd answer (commented on his own answer), and thought it deserved to be an official answer:
Create an exceptions.php file, put it on the
Lib
folder and fill it up with all your*Exception
classes. Then include it on your application's bootstrap file.require APP . 'Lib' . DS . 'exceptions.php';
All exceptions will become available application wide.