I have a component slot in my layout which, if rendered, I want to fill with a component from the current module. However the component takes variables, such as an object from my model layer. I can't pass the object from the layout when the component slot is rendered because the various components which may fill that slot take different variables. So I want to pass variables to the component when I set the component which is to fill the slot.
This patch enables me to do so by calling:
$view->setComponentSlot('sidebar', $this->getModuleName(), 'menu', array('repository' => $this->repository));
Much thanks, Jack