Commit eeff4ac7 authored by Shakarim Sapa's avatar Shakarim Sapa

- В модель добавлена валидация и названия заголовков для поля subject

parent f8a6971e
......@@ -11,6 +11,7 @@ use Yii;
* @property string $name
* @property string $template
* @property string $created_at
* @property string $subject
*/
class MessageTemplate extends \common\components\ActiveRecordModel
{
......@@ -48,10 +49,10 @@ class MessageTemplate extends \common\components\ActiveRecordModel
public function rules()
{
return [
[['name', 'template'], 'required'],
[['name', 'template', 'subject'], 'required'],
[['template'], 'string'],
[['created_at'], 'safe'],
[['name'], 'string', 'max' => 255],
[['name', 'subject'], 'string', 'max' => 255],
];
}
......@@ -65,6 +66,7 @@ class MessageTemplate extends \common\components\ActiveRecordModel
'name' => 'Название',
'template' => 'Шаблон',
'created_at' => 'Дата создания',
'subject' => 'Тема сообщения'
];
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment