YuriiChmil
YuriiChmil

Reputation: 481

how change items in view of admin panel yii

I create admin panel in yii1 via CRUD. In list section display news with status (1 and 2). But i need display "Publish" and "Archive" instead 1 and 2. I did this in view but this way wrong.How i can do it?

Upvotes: 0

Views: 37

Answers (1)

RDK
RDK

Reputation: 4560

You can try change zii.widgets.grid.CGridView if you use it. Something like this:

'columns'  => [
                    [
                        'type'  => 'html',
                        'name' => 'status',
                        'value' => '"<div class=helper>". (1 === $data->status) ? 'Archive' : 'Publish' ."</div>"',
                        'htmlOptions' => ['data-label' => 'Status']
                    ],

Upvotes: 0

Related Questions