I need to create some base exception classes and inherit from it.
I see two approaches:
1. Create folder 'Exceptions' in library and use standard autoload mechanism
/library
/Exception/
Base.php
InvalidParameter.php
2. Just declare exception classes in model, that uses it.
Is there a better more “Zend-ish” approach?
If you look into zend library, what they normally do is
And InvalidParameter Class would look something like Exception_InvalidParameter extends Exception. It is quite similar to what you have suggested in option 1.
I generally love to have all my custom library classes in to
/library/custom