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
4141 */
4242 private static $ list ;
4343
44+ /**
45+ * @var string message category
46+ */
47+ public static $ messageCategory = 'yii2mod.enum ' ;
48+
4449 /**
4550 * Sets the value that will be managed by this type instance.
4651 *
@@ -134,7 +139,7 @@ public static function listData()
134139 self ::$ list [$ class ] = $ reflection ->getStaticPropertyValue ('list ' );
135140 }
136141 $ result = ArrayHelper::getColumn (self ::$ list [$ class ], function ($ value ) {
137- return Yii::t (' yii2mod.enum ' , $ value );
142+ return Yii::t (self :: $ messageCategory , $ value );
138143 });
139144 return $ result ;
140145 }
@@ -148,7 +153,7 @@ public static function getLabel($value)
148153 {
149154 $ list = self ::listData ();
150155 if (isset ($ list [$ value ])) {
151- return Yii::t (' yii2mod.enum ' , $ list [$ value ]);
156+ return Yii::t (self :: $ messageCategory , $ list [$ value ]);
152157 }
153158 return null ;
154159 }
You can’t perform that action at this time.
0 commit comments