mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 14:26:54 +08:00
Update tutorial-core-validators.md
The maxSize validator validates in bytes, so the example was incorrect (it was 1GB instead of 1MB).
This commit is contained in:
@ -240,7 +240,7 @@ either a single column or multiple columns.
|
|||||||
[
|
[
|
||||||
// checks if "primaryImage" is an uploaded image file in PNG, JPG or GIF format.
|
// checks if "primaryImage" is an uploaded image file in PNG, JPG or GIF format.
|
||||||
// the file size must be less than 1MB
|
// the file size must be less than 1MB
|
||||||
['primaryImage', 'file', 'extensions' => ['png', 'jpg', 'gif'], 'maxSize' => 1024*1024*1024],
|
['primaryImage', 'file', 'extensions' => ['png', 'jpg', 'gif'], 'maxSize' => 1024*1024],
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user