mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-15 22:09:48 +08:00
make null format look nice by default
This commit is contained in:
@@ -18,6 +18,11 @@ body {
|
|||||||
padding: 14px 24px;
|
padding: 14px 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.not-set {
|
||||||
|
color: #c55;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
/* add sorting icons to gridview sort links */
|
/* add sorting icons to gridview sort links */
|
||||||
a.asc:after, a.desc:after {
|
a.asc:after, a.desc:after {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
@@ -18,6 +18,11 @@ body {
|
|||||||
padding: 14px 24px;
|
padding: 14px 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.not-set {
|
||||||
|
color: #c55;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
/* add sorting icons to gridview sort links */
|
/* add sorting icons to gridview sort links */
|
||||||
a.asc:after, a.desc:after {
|
a.asc:after, a.desc:after {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
@@ -19,6 +19,11 @@ body {
|
|||||||
padding: 14px 24px;
|
padding: 14px 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.not-set {
|
||||||
|
color: #c55;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
/* add sorting icons to gridview sort links */
|
/* add sorting icons to gridview sort links */
|
||||||
a.asc:after, a.desc:after {
|
a.asc:after, a.desc:after {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class Formatter extends Component
|
|||||||
*/
|
*/
|
||||||
public $datetimeFormat = 'Y/m/d h:i:s A';
|
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;
|
public $nullDisplay;
|
||||||
/**
|
/**
|
||||||
@@ -69,7 +69,7 @@ class Formatter extends Component
|
|||||||
$this->booleanFormat = [Yii::t('yii', 'No'), Yii::t('yii', 'Yes')];
|
$this->booleanFormat = [Yii::t('yii', 'No'), Yii::t('yii', 'Yes')];
|
||||||
}
|
}
|
||||||
if ($this->nullDisplay === null) {
|
if ($this->nullDisplay === null) {
|
||||||
$this->nullDisplay = Yii::t('yii', '(not set)');
|
$this->nullDisplay = '<span class="not-set">' . Yii::t('yii', '(not set)') . '</span>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user