It's common to have separate layouts in multi-tier applications. Suppose that there are 'admin', 'forum' and 'site' tier or modules and each one has its own layout in views.
The worst thing about YII error handling is that it's not possible to change the layout
file for error handler based on application tier or module.
In YIIs global configuration file we enable errorHandler
module as following:
'errorHandler' => [
'errorAction' => 'site/error',
],
we define an error handler action globally for the whole application and there is no option the change it during app runtime. Even inside that errorAction there is no option to change the layout
file or the view file outside its scope.
What solution could be possible and enough straightforward to have each error to be shown inside the layout
of where it has been raised?