本文整理匯總了PHP中dektrium\user\models\User::setProfile方法的典型用法代碼示例。如果您正苦於以下問題:PHP User::setProfile方法的具體用法?PHP User::setProfile怎麽用?PHP User::setProfile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類dektrium\user\models\User
的用法示例。
在下文中一共展示了User::setProfile方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: loadAttributes
/**
* @inheritdoc
*/
protected function loadAttributes(\dektrium\user\models\User $user)
{
$user->setAttributes(['email' => $this->email, 'username' => $this->username, 'password' => $this->password]);
$profile = \Yii::createObject(Profile::className());
$profile->setAttributes(['name' => ucwords(strtolower($this->firstname)) . " " . ucwords(strtolower($this->lastname)), 'firstname' => ucwords(strtolower($this->firstname)), 'lastname' => ucwords(strtolower($this->lastname)), 'birthday' => $this->birthday, 'terms' => $this->terms]);
$user->setProfile($profile);
}
示例2: loadAttributes
public function loadAttributes(User $user)
{
$user->setAttributes($this->attributes);
$profile = \Yii::createObject(Profile::className());
$profile->setAttributes(['name' => $this->name]);
$user->setProfile($profile);
}