How do I use a Controller to render a Widget instead of a Driver?

Topics: Writing modules
Oct 23, 2011 at 1:25 AM

I wanted to have a go at using a Controller to render a widget. The widget would build up a series of shapes in a function then pass them into a view

Where inside the view I would do something like

@Display(Model.A)
@Display(Model.B)
@Display(Model.C)

to render each shape.

But I am at a loss of how to call into a Controller when rending the widget. Usually I can write a WidgetDriver, override the Display function and this automatically called when displayed. Is there anything similar for a Controller?

 

Cheers

Coordinator
Oct 31, 2011 at 11:38 PM

WorkContext.Layout.NameOfTheZoneWhereYouWantTheWidgetAlthoughTechnicallyThatWouldntBeAWidgetButRatherAShape.Add(myShape, "1") where "1" is the position in the zone.