简体   繁体   中英

Customize CButtonColumn

I use CButtonColumn look like this:

 <?php $this->widget('zii.widgets.grid.CGridView', array(
             'id'=>'user-grid',
             'dataProvider'=>$model->search(),
             'filter'=>$model,
             'pager' => array(
                 'firstPageLabel' => '&lt;&lt;', 
                 ),
             'columns'=>array(
                 'username',
                 'name',
                 'email',
                 'creationDate',
                 array(
                         'class' => 'CButtonColumn',
                         'template' => '{change} {view}',
                         'button' => array(
                            'change' => array(
                                'url' => 'aaaaaaaa',
                            ),
                     ),
                 )
             ),
         )); ?>

And i got an error:

Use of undefined constant aaaaaaaa - assumed 'aaaaaaaa'

How I can cusomize CButtonColumn rightly?

'url'=>'Yii::app()->createUrl("your_controller/action")',

Try

'url' => '"aaaaaaaa"'

instead

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM