If this other structure is only related to the view, you should keep it in the view. If this structure is used in more than one view, make an assistant for it.
Internally, your application must standardize in a single data format, so models should always return a standardized format. If you have to do something with this data in your controller, you will need to change the logic of interacting with data in only one controller function, which in this case does not make much sense. If you later decide to change the format in the model, you will also need to change the code in the controller that interacts with it. Do not create dependencies if there are no benefits to this.
source
share