make null format look nice by default

This commit is contained in:
Carsten Brandt
2013-12-10 20:42:09 +01:00
parent fec58f4e29
commit 2c9a8b910f
4 changed files with 17 additions and 2 deletions

View File

@@ -40,7 +40,7 @@ class Formatter extends Component
*/
public $datetimeFormat = 'Y/m/d h:i:s A';
/**
* @var string the text to be displayed when formatting a null. Defaults to '(not set)'.
* @var string the text to be displayed when formatting a null. Defaults to '<span class="not-set">(not set)</span>'.
*/
public $nullDisplay;
/**
@@ -69,7 +69,7 @@ class Formatter extends Component
$this->booleanFormat = [Yii::t('yii', 'No'), Yii::t('yii', 'Yes')];
}
if ($this->nullDisplay === null) {
$this->nullDisplay = Yii::t('yii', '(not set)');
$this->nullDisplay = '<span class="not-set">' . Yii::t('yii', '(not set)') . '</span>';
}
}