Hello, the situation:
'i18n' => [
'translations' => [
'app*' => [
'class' => 'yii\i18n\PhpMessageSource',
'basePath' => '@common/messages',
'fileMap' => [
'app' => 'app.php',
'app/custom' => function() {return Configuracoes::getI18NCustom();}
],
],
],
],
This is the configuration of translation on file config.php
The file of config "app/custom", may vary from client to client. Why? Depending on the type of client they will see a message, otherwise you can see another … and so on.
The problem:
No accept functions.
If i call Configuracoes::getI18NCustom()
‘app/custom’ => Configuracoes::getI18NCustom()
The function getI18NCustom contains:
$tipoCliente = \common\modules\configuracao\models\Configuracao::find([‘grupo’ => ‘informacaoCliente’, ‘chave’ => ‘tipo_cliente’])->one();
this line returns an error:
Fatal error: Call to a member function getDb() on a non-object.
How i solve this? Any ideas?
Best Regards,
Rafael