renderPartial with CJuiTabs

Hi, guys.

I’m working with CJuiTabs which will create tabs in layout.

How can I use renderPartial to include a view into each tab?

I’d tried follwing code:




$this->widget('zii.widgets.jui.CJuiTabs', array(

        'tabs' => array(

            'En' => $this->renderPartial("_formLanguages", array(

                'model' => $model,

            )),

        ),

        'options'=>array(

            'collapsible'=>true,

        ),

    ));



In _formLanguages.php:




<div class="class="wide form"">

      Form!

</div>



When I run in browser, the "Form!" is out of "En" tab content!

why?

Hi, I’ve solved this problem :D

When I use $this->renderPartial in CJuiTabs, the content of the view file displayed in out of tab content becasue I missing declare the third param in renderPartial (document for renderPartial)

In particular, this is may code and it worked:




$this->widget('zii.widgets.jui.CJuiTabs', array(

        'tabs'=>array(

          'En' =>$this->renderPartial("_formLanguages", array('model' => $model), $this),

          'Ch'=>$this->renderPartial("_formLanguages", array('model' => $model), $this),

        ),        

        'options'=>array(

            'collapsible'=>true,

        ),

    ));



Just what I needed thanks!

I’ve looked at the doc for renderPartial but I don’t see a param for $this (controller). I.e. the last two params are booleans for return result & process output.

Do you know?

Matt

On a second look, you should pass true instead of $this as your third parameter. This parameter specifies that the result should be returned instead of displayed to the end user. See renderPartial for details.

Matt

thanks guy. This is what I am looking :P