"… a special view that is used to decorate views. It usually contains portions of user interface that are common among several views."
What if a have a widget (slideshow) that receives an array of data to display in a …slideshow =P,
If depending on the view. I need to generate this data from diferent models. say when in the article show view I want the slideshow to display other articles but when in the videos show view I want the slideshow to display other videos…
How should i handle this logic in a good way?, The slideshow for sure should belong to the layout, as it is exactly the same for both views. but where should I put the logic of generating the array that ill pass to it?
I cant put that into the widget as it would then be attached to my models. I want my widgets to receive a generical array of data not carring if it belongs to a model or not. as it sounds because it depends on the model then the controller should have that logic… but… I cant send information to the layout from a controller. so…
what would be your sugestion?