Widget Inside Widget

Hi all,

Does anyone know if it’s possible to insert a widget inside another?

If so, why I’m having this error?

Object of class TestWidget could not be converted to string

Widget’s view:



$form = $this->beginWidget('CActiveForm', array(








provide snippet where you use "TestWidget"

maybe you are doing something like “echo $this->beginWidget( ‘TestWidget’ );”, which requires cast of returned widget object to string…

Thank you! This was exactly my mistake.

I changed:

<?php echo $this->widget(‘TestWidget’);?>


<?php $this->widget(‘TestWidget’);?>