I think it would make sense to have a beforeRender() method in the controller that is called just before any output is send to the client (it could be called as a first thing by render()).
In my web application (ajax) I want to send status information and messages in a json header. I cannot send the header in beforeAction() because I still want to set some json data in the action itself. Neither I want to send the header in the action, since that whould mean repeating code. Currently I am sending the header in the layout view, though I always have to use a layout now. Also there is some more logic involved before sending the header which does not really belong into the layout view. I could use output buffering and send the header in afterAction(), somehow I don't like that approach
A beforeRender() method would solve the whole problem. What do you think?