File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,11 @@ abstract class BaseEnum
41
41
*/
42
42
private static $ list ;
43
43
44
+ /**
45
+ * @var string message category
46
+ */
47
+ public static $ messageCategory = 'yii2mod.enum ' ;
48
+
44
49
/**
45
50
* Sets the value that will be managed by this type instance.
46
51
*
@@ -134,7 +139,7 @@ public static function listData()
134
139
self ::$ list [$ class ] = $ reflection ->getStaticPropertyValue ('list ' );
135
140
}
136
141
$ result = ArrayHelper::getColumn (self ::$ list [$ class ], function ($ value ) {
137
- return Yii::t (' yii2mod.enum ' , $ value );
142
+ return Yii::t (self :: $ messageCategory , $ value );
138
143
});
139
144
return $ result ;
140
145
}
@@ -148,7 +153,7 @@ public static function getLabel($value)
148
153
{
149
154
$ list = self ::listData ();
150
155
if (isset ($ list [$ value ])) {
151
- return Yii::t (' yii2mod.enum ' , $ list [$ value ]);
156
+ return Yii::t (self :: $ messageCategory , $ list [$ value ]);
152
157
}
153
158
return null ;
154
159
}
You can’t perform that action at this time.
0 commit comments