samdark / yii2-cookbook

Yii 2.0 Community Cookbook
1.44k stars 297 forks source link

[qa] about global functions #89

Open lichunqiang opened 8 years ago

lichunqiang commented 8 years ago

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?

samdark commented 8 years ago

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

lichunqiang commented 8 years ago

Yii framework can handle this scenario will be nice.

samdark commented 8 years ago

Absolutely.