本文整理汇总了PHP中yii\base\Model::attributeLabels方法的典型用法代码示例。如果您正苦于以下问题:PHP Model::attributeLabels方法的具体用法?PHP Model::attributeLabels怎么用?PHP Model::attributeLabels使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\base\Model
的用法示例。
在下文中一共展示了Model::attributeLabels方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: attributeLabels
/**
* @inheritdoc
*/
public function attributeLabels()
{
$labels = parent::attributeLabels();
$labels['name'] = Yii::t('app', 'Name');
$labels['email'] = Yii::t('app', 'Email');
$labels['subject'] = Yii::t('app', 'Subject');
$labels['body'] = Yii::t('app', 'Body');
$labels['verifyCode'] = Yii::t('app', 'Verification Code');
return $labels;
}
示例2: attributeLabels
/**
* @inheritDoc
*/
public function attributeLabels()
{
return ArrayHelper::merge(parent::attributeLabels(), ['url' => 'URL']);
}
示例3: attributeLabels
public function attributeLabels()
{
return array_merge(parent::attributeLabels(), ['name' => \Yii::t('app', 'Name'), 'version' => \Yii::t('app', 'Installed version'), 'alias' => \Yii::t('app', 'Aliases')]);
}
示例4: testDefaults
public function testDefaults()
{
$singer = new Model();
$this->assertEquals([], $singer->rules());
$this->assertEquals([], $singer->attributeLabels());
}
示例5: attributeLabels
public function attributeLabels()
{
return \yii\helpers\ArrayHelper::merge(parent::attributeLabels(), ['username' => 'email']);
}
示例6: attributeLabels
public function attributeLabels()
{
$labels = ['username' => '用户名', 'email' => '邮箱', 'password' => '密码', 'confirmPassword' => '确认密码', 'verifyCode' => '验证码'];
return array_merge(parent::attributeLabels(), $labels);
}
示例7: attributeLabels
/**
* @return array customized attribute labels
*/
public function attributeLabels()
{
return array_merge(parent::attributeLabels(), ['verifyCode' => Yii::t('app', 'Verification Code')]);
}
示例8: attributeLabels
public function attributeLabels()
{
$labels = ['username' => '用户名', 'password' => '密码', 'rememberMe' => '记住我'];
return array_merge(parent::attributeLabels(), $labels);
}