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

[qa] about global functions

Open lichunqiang opened this issue 9 years ago • 3 comments
trafficstars

as you said:

function t($message, $params = [], $category = 'app', $language = null)
{
    return Yii::t($category, $message, $params, $language);
}

this is shorthand function for Yii::t.

My question is that how to make yii/message to meet this function.

I tried and found that, the yii/message will extract the message as Yii::t defined params order, so If i changed the order of params and the yii/message can not work well.

Any suggestion?

lichunqiang avatar Dec 08 '15 09:12 lichunqiang

Yes, I think it's something it could not handle now. Needs to be improved...

samdark avatar Dec 08 '15 11:12 samdark

Yii framework can handle this scenario will be nice.

lichunqiang avatar Dec 08 '15 13:12 lichunqiang

Absolutely.

samdark avatar Dec 08 '15 13:12 samdark