From fbb9918a46292a811b4046885228472eddeee5ec Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Mon, 30 Dec 2013 19:21:39 +0100 Subject: [PATCH] fixed an issue with message source and model as params --- framework/yii/i18n/I18N.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/framework/yii/i18n/I18N.php b/framework/yii/i18n/I18N.php index 3955e84..7123342 100644 --- a/framework/yii/i18n/I18N.php +++ b/framework/yii/i18n/I18N.php @@ -8,6 +8,7 @@ namespace yii\i18n; use Yii; +use yii\base\Arrayable; use yii\base\Component; use yii\base\InvalidConfigException; @@ -94,7 +95,11 @@ class I18N extends Component */ public function format($message, $params, $language) { - $params = (array)$params; + if ($params instanceof Arrayable) { + $params = $params->toArray(); + } else { + $params = (array)$params; + } if ($params === []) { return $message; }