Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

UserImportUploadForm.php 725B

123456789101112131415161718192021222324252627282930313233343536
  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. ?>