marc_bcn
(Onmatchapp)
1
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!
redguy
(Maciej Lizewski)
2
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…
marc_bcn
(Onmatchapp)
3
Thank you! This was exactly my mistake.
…
I changed:
<?php echo $this->widget(‘TestWidget’);?>
to
<?php $this->widget(‘TestWidget’);?>