Answer the question
In order to leave comments, you need to log in
How to globally change error messages in YII2?
Hello.
Models in Yii2 have a custom message field for Javascript client-side validation:
public function rules()
{
return array(
array('title, content', 'required',
'message'=>'Введите значение {attribute}.'),
// другие правила валидации
);
}
Answer the question
In order to leave comments, you need to log in
I found the answer on this site
pro-cod.ru/yii2-ustanovit-russkij-yazyk.html
I'll duplicate it just in case.
If you need to install the Russian language, just add the 'language' => 'ru-RU' parameter for the advanced template, this is the main.php file
path - root/common/config/main.php
<?php
return [
'language' => 'ru-RU',
'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
'components' => [
'cache' => [
'class' => 'yii\caching\FileCache',
],
],
];
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question