You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
725B

  1. <?php
  2. namespace backend\forms;
  3. use yii\base\Model;
  4. use yii\web\UploadedFile;
  5. class UserImportUploadForm extends Model
  6. {
  7. /**
  8. * @var UploadedFile file attribute
  9. */
  10. public $file;
  11. public $send_mail_welcome;
  12. /**
  13. * @return array the validation rules.
  14. */
  15. public function rules()
  16. {
  17. return [
  18. [['file'], 'file', 'skipOnEmpty' => false, 'mimeTypes' => 'text/csv, text/plain'],
  19. [['send_mail_welcome'], 'boolean']
  20. ];
  21. }
  22. public function attributeLabels()
  23. {
  24. return [
  25. 'file' => "Fichier d'import (CSV)",
  26. 'send_mail_welcome' => "Envoyer un email de bienvenue aux utilisateurs importés"
  27. ];
  28. }
  29. }
  30. ?>