Created
July 14, 2012 03:20
-
-
Save jamband/3109052 to your computer and use it in GitHub Desktop.
ii Framework: label hint v2
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 | |
class Register extends User | |
{ | |
/** | |
* @var string パスワード(確認) | |
*/ | |
public $verifyPassword; | |
/** | |
* @var string 認証コード | |
*/ | |
public $verifyCode; | |
/** | |
* @see CModel::attributeLabels() | |
*/ | |
public function attributeLabels() | |
{ | |
return array( | |
'username' => 'ユーザ名', | |
'email' => 'メールアドレス', | |
'password' => 'パスワード', | |
'verifyPassword' => 'パスワード(確認)', | |
'verifyCode' => '認証コード', | |
); | |
} | |
... |
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
新規登録を行います<br /> | |
以下のフォームに必要な情報を入力してください | |
<div class="form"> | |
<?php echo CHtml::statefulForm(); ?> | |
<?php echo CHtml::errorSummary($register, ''); ?> | |
<div class="row"> | |
<?php echo CHtml::activeLabel($register, 'username'); ?> | |
<?php echo CHtml::activeTextField($register, 'username', array('maxlength' => 32)); ?> | |
半角英数字で<?php echo $register->usernameMinLength.'~'.$register->usernameMaxLength; ?>文字以内 | |
</div> | |
<div class="row"> | |
<?php echo CHtml::activeLabel($register, 'email'); ?> | |
<?php echo CHtml::activeTextField($register, 'email', array('maxlength' => 32)); ?> | |
例: [email protected] | |
</div> | |
<div class="row"> | |
<?php echo CHtml::activeLabel($register, 'password'); ?> | |
<?php echo CHtml::activePasswordField($register, 'password', array('maxlength' => 64)); ?> | |
半角英数字で<?php echo $register->passwordMinLength; ?>文字以上 | |
</div> | |
<div class="row"> | |
<?php echo CHtml::activeLabel($register, 'verifyPassword'); ?> | |
<?php echo CHtml::activePasswordField($register, 'verifyPassword', array('maxlength' => 64)); ?> | |
</div> | |
<?php if (CCaptcha::checkRequirements()): ?> | |
<div class="row"> | |
<?php $this->widget('CCaptcha'); ?> | |
<?php echo CHtml::activeLabel($register, 'verifyCode'); ?> | |
<?php echo CHtml::activeTextField($register, 'verifyCode'); ?> | |
上に表示されている文字を入力してください | |
</div> | |
<?php endif; ?> | |
<div class="row"> | |
<?php echo CHtml::submitButton('入力した内容を確認する', array('name' => 'confirm')); ?> | |
</div> | |
<?php echo CHtml::endForm(); ?> | |
</div><!-- /.form --> | |
<?php endif; ?> |
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 | |
class User extends ActiveRecord | |
{ | |
public $usernameMinLength; | |
public $usernameMaxLength; | |
public $passwordMinLength; | |
public $passwordMaxLength; | |
/** | |
* @see CActiveRecord::init() | |
*/ | |
public function init() | |
{ | |
$this->usernameMinLength = Yii::app()->getModule('user')->usernameMinLength; | |
$this->usernameMaxLength = Yii::app()->getModule('user')->usernameMaxLength; | |
$this->passwordMinLength = Yii::app()->getModule('user')->passwordMinLength; | |
$this->passwordMaxLength = Yii::app()->getModule('user')->passwordMaxLength; | |
} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment