Don't print widget when call it

Hello guys, I’m using the jquery widget, but there’s one thing I wanted to change. Every time I enter a widget of these is printed in the exact spot where the call. I would like to put the contents of a widget into a variable for later use. As a solution, I extended the widget to do this. But I was wondering if there is a way, perhaps using behaviors to achieve this result.

thanks

Tried setting $captureOutput to true?

http://www.yiiframework.com/doc/api/1.1/CBaseController#widget-detail

thanks. it’s work perfectly