Friday, October 15, 2010

Yii's CDetailView

Thanks, now I know how to handle changing the numeric representations into their string equivalents, just like in the blog tutorial:

$this->widget('zii.widgets.CDetailView', array(
'data'=>$model,
'attributes'=>array(
'id',
'title',
'content',
'tags',
array(
'name'=>'status',
'value'=>Lookup::item('PostStatus',$model->status)
),
'create_time',
'update_time',
array(
'name'=>'author_id',
'value'=>User::model()->find(
'id=:author_id',
array(
':author_id'=>$model->author_id
)
)->username,
),
),
));

No comments: