Skip to content
Advertisement

How to use custom exception from cakephp plugin?

I have some custom exception for my application. I placed them to app where it is running well. Now I want to move them to one of my plugin and use exception from their.

I have implemented custom exception as mentioned here: http://book.cakephp.org/2.0/en/development/exceptions.html

But, I am looking for same solution if I use exception classes from cakephp plugin.

Any suggestion…???

Advertisement

Answer

Lets say you want to put your exceptions in Custom plugin /app/Plugin/Custom/Lib folder:

JavaScript

Now you need to load Custom plugin in /app/Config/bootstrap.php:

JavaScript

And wherever you want to use CustomException:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement