Jorge Alameda
Jorge Alameda

Reputation: 23

Yii Framework CDetailView "No set" label

When there is no any data in one column the words "No set" are displayed, i want to change this message but i don't know where o how to do it, i have try extending CDetailView but it didn't work, any sggestion?

Upvotes: 1

Views: 262

Answers (1)

Willem Renzema
Willem Renzema

Reputation: 5187

Instead of using

array(
  'attributeName1',
  'attributeName2',
)

when defining the data to display in your detail view, use

array(
  array(
    'label'=>'Whatever you want',
    'value'=>null===$model->attributeName1?
      "custom message":
      $model->attributeName1,
  ),
  'attributeName2',
)

This gives you the power to format the content however you want it.

Upvotes: 1

Related Questions