Search code examples
phpyiitargetcgridviewcbuttoncolumn

when I click view button in CGridView, it is opened in a new window


I used from CGridView in framework Yii, I want when I click view button , it is opened in a new window how can I add of "_new" of target ?


Solution

  • Add 'options' => array('target'=>'_new') to CButtonColumn configuration array in CGridView

    array(
        'class'=>'zii.widgets.grid.CButtonColumn',
        'template' => '{view}',
        'buttons'=>array(
            'view' => array(
                'url' => '', // view url
                'options' => array('target' => '_new'),
            ),
        ),
    ),