Guest User

Untitled

a guest
Nov 24th, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * Frontend Register class file.
  5. */
  6. class Register extends User
  7. {
  8. ...
  9.  
  10. public function attributeLabels()
  11. {
  12. $username = 'ユーザ名';
  13. $email = 'メールアドレス';
  14. $password = 'パスワード';
  15. $verifyPassword = 'パスワード(確認)';
  16. $verifyCode = '認証コード';
  17.  
  18. // hint
  19. $format = Yii::app()->format;
  20. $usernameHint = $username.$format->hint('半角英数字で'.$this->usernameMinLength.'~'.$this->usernameMaxLength.'文字以内');
  21. $emailHint = $email.$format->hint('例: test@example.com');
  22. $passwordHint = $password.$format->hint('半角英数字で'.$this->passwordMinLength.'文字以上');
  23. $verifyCodeHint = $verifyCode.$format->hint('上に表示されている文字を入力してください');
  24.  
  25. return compact(
  26. 'username', 'email', 'password', 'verifyPassword', 'verifyCode',
  27. 'usernameHint', 'emailHint', 'passwordHint', 'verifyCodeHint'
  28. );
  29. }
  30.  
  31. ...
Add Comment
Please, Sign In to add comment