Here’s a counterpoint to the currently popular view of “fat controllers are bad”, and the current fad of everyone and their cousin implementing service layers: You don’t need one. Fat controllers are okay too.
How to use built-in SPL exception classes for better error handling
Since PHP 5, there has been a bundle of built-in exceptions – the “SPL exceptions” – in PHP. However, the documentation for these classes is quite lacking in examples, and it can be difficult to understand when you should be using them. The short answer is always. You’ll find a longer answer if you continue reading :) There is also …