本文整理匯總了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);
}