Nested Widget

Hi ,

i use a CActiveForm widget in my view and i need to use another widget i created inside this Form.

But it seems that when i call my widget it also close the CActiveForm one




<?php

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

                                                              'id'=>'project-form',

                                                              'action'=>'/createProject',

                                                              'focus'=>'#public_name',

                                                              'enableAjaxValidation'=>true,

                                                              'enableClientValidation'=>true,

                                                              'clientOptions' => array(

                                                                'validateOnSubmit' => true,

                                                                'validateOnChange' => true,

                                                                'validateOnType'   => true,

                                                              ),

                                                              'htmlOptions' => array('class'=>'basic-form form-horizontal'),

                                                         ));

?>


<fieldset>

...

</fieldset>


<fieldset>

    <?php

    $this->widget('application.components.profile.widget.Roles');

    ?>

</fieldset>


<fieldset>

...

</fieldset>


<?php // close the form widget

$this->endWidget(); 

?>




And when i look at the generated code the form is closed just after the second widget , all fieldsets after that are outside form .

What i am doing wrong ?

Thanks.

OK , i figured it out !

In the second widget i must set the third parameter $captureOutput to true as explained here http://www.yiiframework.com/doc/api/1.1/CBaseController#widget-detail.

But this seems to be introduced in 1.1.2

Was it impossible before this version ?