Created
July 13, 2012 16:01
-
-
Save jamband/3105681 to your computer and use it in GitHub Desktop.
Yii Framework: label hint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Frontend Register class file. | |
*/ | |
class Register extends User | |
{ | |
... | |
public function attributeLabels() | |
{ | |
$username = 'ユーザ名'; | |
$email = 'メールアドレス'; | |
$password = 'パスワード'; | |
$verifyPassword = 'パスワード(確認)'; | |
$verifyCode = '認証コード'; | |
// hint | |
$format = Yii::app()->format; | |
$usernameHint = $username.$format->hint('半角英数字で'.$this->usernameMinLength.'~'.$this->usernameMaxLength.'文字以内'); | |
$emailHint = $email.$format->hint('例: [email protected]'); | |
$passwordHint = $password.$format->hint('半角英数字で'.$this->passwordMinLength.'文字以上'); | |
$verifyCodeHint = $verifyCode.$format->hint('上に表示されている文字を入力してください'); | |
return compact( | |
'username', 'email', 'password', 'verifyPassword', 'verifyCode', | |
'usernameHint', 'emailHint', 'passwordHint', 'verifyCodeHint' | |
); | |
} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment