-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to set required (must be set) on upload form #37
Comments
Does it work if you set the rules inside app config? 'modules' => [
...
'attachments' => [
'class' => nemmo\attachments\Module::className(),
'rules' => [ // Rules according to the FileValidator
'maxFiles' => 10, // Allow to upload maximum 3 files, default to 3
'mimeTypes' => 'image/png', // Only png images
'maxSize' => 1024 * 1024 // 1 MB
],
]
...
] But I think it will not work. Thus it will be an enhancement. Added to checklist #36 |
Yes I did not try it inside the app config It's so I need at this moment, if you could explain a temporary method that allows this currently ? while I waited for the enhancement Thanks |
You can fork or download the whole module and add this feature inside file behavior. I think the right way is to check the file existance on before save event |
Sorry, add this feature inside file behavior or check the file existance on before save event, I can't understand how to write it, I was newbie, can you also explain the example code. (While waiting in the newest version for the best method) |
In rule is provided FileValidator, how to add a required option ?
The text was updated successfully, but these errors were encountered: