Browse Source

fixed an issue with message source and model as params

tags/2.0.0-beta
Carsten Brandt 11 years ago
parent
commit
fbb9918a46
  1. 7
      framework/yii/i18n/I18N.php

7
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;
}

Loading…
Cancel
Save