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:

[indent]


<?php





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

		'id'=>'my-form',

		'enableAjaxValidation'=>false

));


$this->endWidget();


?>

[/indent]

Thanks!

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’);?>

to

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