Open sergeizhukov opened 4 years ago
Hello. Can you help me? Idk where to search the reason but try to update fields via _ it doesn't work: Configuration:
public function behaviors() :array { return [ MultilingualBehavior::class => [ 'class' => MultilingualBehavior::class, 'languages' => [ 'de' => 'German', 'fr' => 'French', ], 'langClassName' => I18nLang::class, 'langForeignKey' => 'owner_id', 'tableName' => '{{%i18n_lang}}', 'attributes' => [ 'value' ] ], ];
rules:
public function rules(): array { return [ [['name', 'value', 'value_de', 'value_fr'], 'safe'] ]; }
So try to do like in tests:
$m = I18n::find()->multilingual()->where(['id' => $id])->one(); $m->setAttributes([ 'value_de' => 'text', ]); $m->value_de = 'text'; $m->save();
Is empty:
But it works if i will do $m->value = 'text'; then it goes correct.
$m->value = 'text';
What I do wrong?
Hello. Can you help me? Idk where to search the reason but try to update fields via _ it doesn't work: Configuration:
rules:
So try to do like in tests:
Is empty:
But it works if i will do
$m->value = 'text';
then it goes correct.What I do wrong?