同步操作将从 小肥羊/phpapp 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<?phpnamespace app\models;use Yii;use yii\base\Model;/*** ContactForm is the model behind the contact form.*/class ContactForm extends Model{public $name;public $email;public $subject;public $body;public $verifyCode;/*** @return array the validation rules.*/public function rules(){return [// name, email, subject and body are required[['name', 'email', 'subject', 'body'], 'required'],// email has to be a valid email address['email', 'email'],// verifyCode needs to be entered correctly['verifyCode', 'captcha'],];}/*** @return array customized attribute labels*/public function attributeLabels(){return ['verifyCode' => 'Verification Code',];}/*** Sends an email to the specified email address using the information collected by this model.* @param string $email the target email address* @return bool whether the model passes validation*/public function contact($email){if ($this->validate()) {Yii::$app->mailer->compose()->setTo($email)->setFrom([$this->email => $this->name])->setSubject($this->subject)->setTextBody($this->body)->send();return true;}return false;}}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。