当前位置: 首页>>代码示例>>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;未经允许,请勿转载。