當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UserHelper::sendEmailConfirmation方法代碼示例

本文整理匯總了PHP中UserHelper::sendEmailConfirmation方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserHelper::sendEmailConfirmation方法的具體用法?PHP UserHelper::sendEmailConfirmation怎麽用?PHP UserHelper::sendEmailConfirmation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UserHelper的用法示例。


在下文中一共展示了UserHelper::sendEmailConfirmation方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: register

 public function register()
 {
     $user = new User();
     $user->first_name = $this->first_name;
     $user->last_name = $this->last_name;
     $user->email = $this->email;
     $user->position = $this->position;
     $user->phone = $this->phone;
     $user->password = $this->password;
     $user->username = $this->username;
     $user->role = User::ROLE_EMPL;
     $user->status = User::STATUS_DISABLED;
     $user->additional_contact = $this->additional_contact;
     $user->hash = md5(microtime(true) . rand());
     if (!$user->save()) {
         $this->addError('username', 'Can`t create user ' . serialize($user->getErrors()));
         return false;
     }
     UserHelper::sendEmailConfirmation($user);
     $company = new Company();
     $company->name = $this->name;
     $company->site_url = $this->site_url;
     $company->address = $this->address;
     $company->created_at = new CDbExpression('NOW()');
     $company->updated_at = new CDbExpression('NOW()');
     if (!$company->save()) {
         $this->addError('name', 'Can`t create company ' . serialize($company->getErrors()));
         return false;
     }
     $bind = new UserToCompany();
     $bind->user_id = $user->id;
     $bind->company_id = $company->id;
     if (!$bind->save()) {
         $this->addError('name', 'Can`t bind company ' . serialize($bind->getErrors()));
         return false;
     }
     return true;
 }
開發者ID:asopin,項目名稱:portal,代碼行數:38,代碼來源:RegisterCompanyForm.php


注:本文中的UserHelper::sendEmailConfirmation方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。