.CListView and arrays

I have the table users that have a column "active".

So there is a CListView with a cdataprovider of users at the index of users controller.

How can I write "active" or "unactive" for the values 1 or 0 of the "active" field at CListView?

I have also at users model


 public function retactive() {

        return array($this::ACTIVE=>'active' , $this::UNACTIVE=>'unactive' );


    }

the view




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

	'dataProvider'=>$dataProvider,

	'itemView'=>'_view',

));

....

<b><?php echo CHtml::encode($data->getAttributeLabel('us_active')); ?>:</b>

	<?php echo CHtml::encode($data->us_active); ?>

	<br />

I tried this and it worked,maybe there is a better solution…


class Users extends CActiveRecord {

...

public $act;

........

protected function afterFind() {

        parent::afterFind();

//return "active" if us_active=1,"unactive if us_active=0

        $this->act = $this->tactive($this->us_active);

    }....

My simple thinking




 <?php echo ($data->us_active=='1') ? 'Active':'UnActive'; ?>