yii2-enum icon indicating copy to clipboard operation
yii2-enum copied to clipboard

Slow work without i18n

Open floor12 opened this issue 6 years ago • 0 comments

I noticed what if the app does not use i18n at all and app has not any lang files, method ::getLabel() work really really slow, because it tries to find get label with Yii::t(). I noticed this problem in gridView. I think the right solution is to change public static $messageCategory = 'app'; to public static $messageCategory; and make a check in ::getLabel() method.

I noticed, if i have disabled i18n my yii2 app, much faster use Enum::$list[$id] instead if Enum::getLabel($id). The difference is hundreds of ms.

floor12 avatar Apr 12 '19 10:04 floor12