LoginForm::attributeLabels PHP Méthode

attributeLabels() public méthode

public attributeLabels ( ) : array
Résultat array
    public function attributeLabels()
    {
        return ['email' => Yii::t('UserModule.user', 'Email/Login'), 'password' => Yii::t('UserModule.user', 'Password'), 'remember_me' => Yii::t('UserModule.user', 'Remember me'), 'verifyCode' => Yii::t('UserModule.user', 'Check code')];
    }

Usage Example

Exemple #1
0
 public function testWithBehavior()
 {
     $form = new LoginForm();
     $formAttributes = $form->attributeNames();
     $formRules = $form->rules();
     $formLabels = $form->attributeLabels();
     $form->attachBehavior('captcha', array('class' => 'CaptchaFormBehavior'));
     $behaviorAttributes = $form->asa('captcha')->attributeNames();
     $behaviorRules = $form->asa('captcha')->filterRules();
     $behaviorLabels = $form->asa('captcha')->attributeLabels();
     $this->assertEquals(array_merge($formAttributes, $behaviorAttributes), $form->attributeNames());
     $this->assertEquals(array_merge($formRules, $behaviorRules), $form->rules());
     $this->assertEquals(array_merge($formLabels, $behaviorLabels), $form->attributeLabels());
     $form->detachBehavior('captcha');
     $this->assertEquals($formAttributes, $form->attributeNames());
     $this->assertEquals($formAttributes, $form->attributeNames());
 }
All Usage Examples Of LoginForm::attributeLabels