Yii2 Error Custom Layout

what’s the best way to render a error with a custom layout in yii2?

I think you can simply configure ErrorHandler component, it has some nice properties like errorView and exceptionView.

i take a look in it … hasn’t the layout.

So i think that it can be done extendig the class and canching response…

I think is a good think add a simple propriety to inject the layout.

You can define errorAction that is called in case of error and render your own view template and layout there.