How Send Parameter And Check Variable In Dialog?


I try send parameter do zii.widgets.jui.CJuiDialog e.g:

$("#dialog-animation").dialog( { my_name: 'Update' } ).dialog( 'open' ); 

and my dialog example:

$this->beginWidget('zii.widgets.jui.CJuiDialog', array(

    'id' => 'dialog-animation',

    'options' => array(

        'title' => 'Dialog box - Animation',

        'modal' => true,

        'autoOpen' => false,

        'height' => 'auto',

        'width' => 'auto',

        'show' => array(

            'effect' => 'blind',

            'duration' => 1000,


        'hide' => array(

            'effect' => 'explode',

            'duration' => 500,



        'buttons' => array(

            'OK' => 'js:function(){alert("OK");}',

            'Anuluj' => 'js:function(){ $(this).dialog("close");}',



ok and when i try catch object my_name to variable e.g:

$my_variable = $my_name;

i see error: Undefined variable: my_name

How send correct parameter do zii.widgets.jui.CJuiDialog and print to the inside dialog?


P.S I’m sorry, my English isn’t good.

You can’t pass parameter from js to php, you should make an ajax request.

Can’t you simply:

<?php $this->beginWidget('zii.widgets.jui.CJuiDialog', array('...')) ?>

Write php stuffs here <?php echo $with_params?>

<?php $this->endWidget()?>


You can send the Parameter via javascript to the Controller via ajax Request and then from the Controller you can use render/renderPartial method to transfer the Parameter to View file again.Place this view file inside the cjuidialog.

This is the Simple Solution i think so,please give a try.