There is a great post here which describes how to define a Lookup model such that you can embed lookup values with great ease as follows:-
| 01 | $this->widget('zii.widgets.CDetailView', array( |
| 02 | 'data'=>$model, |
| 03 | 'attributes'=>array( |
| 04 | 'id', |
| 05 | 'title', |
| 06 | 'content', |
| 07 | 'tags', |
| 08 | array( |
| 09 | 'name'=>'status', |
| 10 | 'value'=><span style="color: #ff9900;">Lookup::item('PostStatus',$model->status)</span> |
| 11 | ), |
| 12 | 'create_time', |
| 13 | 'update_time', |
| 14 | array( |
| 15 | 'name'=>'author_id', |
| 16 | 'value'=>User::model()->find( |
| 17 | 'id=:author_id', |
| 18 | array( |
| 19 | ':author_id'=>$model->author_id |
| 20 | ) |
| 21 | )->username, |
| 22 | ), |
| 23 | ), |
| 24 | )); |