Development

#2797 (Support passing variables when component slots are set, instead of rendered)

You must first sign up to be able to contribute.

Ticket #2797 (new defect)

Opened 5 years ago

Support passing variables when component slots are set, instead of rendered

Reported by: jablko Assigned to: fabien
Priority: minor Milestone:
Component: view Version: 1.1.0 DEV
Keywords: Cc:
Qualification: Unreviewed

Description

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

Attachments

component-vars.patch (1.9 kB) - added by jablko on 01/15/08 23:11:40.
Patch to support passing variables when component slots are set

Change History

01/15/08 23:11:40 changed by jablko

  • attachment component-vars.patch added.

Patch to support passing variables when component slots are set