Share view between controller and widget

Hi All

Is there a way to share a view between a component (widget) and a controller ?

eg I have a widget and I want to update it with an ajax call, ow can I call the partail render function of the widget from the controller ?

I think you can build and reuse your component.

1 - Build your widget normaly

2 - In the controller > action call the widget.

how can I call the widget and get the rendered view back to send back with thw ajax call ?

Call it inside the view file.

You can use output buffering to catch the widgets output:


        ob_start();

        $this->widget($widget,$properties);

        $content=ob_get_contents();

        ob_end_clean();



Of course put the above into a helper function…

Of course sometimes you are just to locked up to see the obvious.

Thank you all !!