[英]yii2 custom error message for 'minHeight' rule
這是我的規則
[
['photo_1','photo_2','photo_3','photo_4','photo_5','photo_6'],
'image',
'skipOnEmpty' => true,
'minHeight' => '281',
'minWidth' => '281',
'extensions' => 'png, jpg, gif',
'wrongExtension' => 'Faqat .png, .jpg, yoki .gif formatidagi rasmlarni yuklashingiz mumkin!',
],
如何為“ minHeight”和“ minWidth”編寫自定義錯誤消息?
使用underHeight
和underWidth
鍵(就像您使用wrongExtension
)。
可用的占位符:
{attribute}
:屬性名稱 {file}
:上傳的文件名 {limit}
:$ minWidth(或$ minHeight)的值
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.