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


PHP ContactForm::load方法代碼示例

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


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

示例1: actionContact

 public function actionContact()
 {
     $model = new ContactForm();
     if ($model->load(Yii::$app->request->post()) && $model->contact(Yii::$app->params['adminEmail'])) {
         Yii::$app->session->setFlash('contactFormSubmitted');
     }
     return $this->render('contact', ['model' => $model]);
 }
開發者ID:HaseProgram,項目名稱:royalteams,代碼行數:8,代碼來源:SiteController.php

示例2: actionIndex

 public function actionIndex()
 {
     $model = new ContactForm();
     if ($model->load(Yii::$app->request->post()) && $model->contact(Setting::get('admin_email'))) {
         Yii::$app->session->setFlash('contactFormSubmitted');
         return $this->refresh();
     }
     return $this->render('index', ['contactForm' => $model]);
 }
開發者ID:egor-pisarev,項目名稱:avtodelo22,代碼行數:9,代碼來源:SiteController.php

示例3: actionIndex

 public function actionIndex()
 {
     $model = new ContactForm();
     if ($model->load(\Yii::$app->request->post()) && $model->validate()) {
         \Yii::$app->session->setFlash('contactFormSubmitted');
         return $this->refresh();
     } else {
         return $this->render('index', ['model' => $model]);
     }
 }
開發者ID:xiaohongyang,項目名稱:yii_shop,代碼行數:10,代碼來源:Test2Controller.php

示例4: actionForm

 public function actionForm()
 {
     $model = new ContactForm();
     if ($model->load(Yii::$app->request->post())) {
         if ($model->validate()) {
             return $this->render('entry-confirm', ['model' => $model]);
             return;
         }
     }
     return $this->render('form', ['model' => $model]);
 }
開發者ID:rostiknaz,項目名稱:yii2,代碼行數:11,代碼來源:SiteController.php

示例5: actionContact

 public function actionContact()
 {
     $model = new ContactForm();
     if ($model->load(Yii::$app->request->post()) && $model->validate()) {
         $body = '<div>Body: <b>' . $model->body . '</b></div>';
         $body .= '<div>Email: <b>' . $model->email . '</b></div>';
         Yii::$app->common->sendMail($model->subject, $body);
         print 'Send success';
         die;
     }
     return $this->render('contact', ['model' => $model]);
 }
開發者ID:karliv,項目名稱:construction_company,代碼行數:12,代碼來源:MainController.php

示例6: actionContact

 /**
  * @param null|\app\core\admpages\models\Page $modelPage
  * @return string|\yii\web\Response
  */
 public function actionContact($modelPage = null)
 {
     $model = new ContactForm();
     if ($model->load(Yii::$app->request->post()) && $model->validate()) {
         if ($model->sendEmail()) {
             Yii::$app->session->setFlash('success', Yii::t("app/contacts", "Thank you for contacting us. We will respond to you as soon as possible.", ['dot' => false]));
             return $this->refresh();
         }
         Yii::$app->session->setFlash('error', Yii::t("app/contacts", "There was an error sending email.", ['dot' => false]));
     }
     return $this->render('contact', ['model' => $model, 'modelPage' => $modelPage]);
 }
開發者ID:pavlinter,項目名稱:yii2-app-core,代碼行數:16,代碼來源:PagesController.php

示例7: actionContact

 /**
  * Displays the contact static page and sends the contact email.
  *
  * @return string|\yii\web\Response
  */
 public function actionContact()
 {
     $model = new ContactForm();
     if ($model->load(Yii::$app->request->post()) && $model->validate()) {
         if ($model->contact(Yii::$app->params['adminEmail'])) {
             Yii::$app->session->setFlash('success', Yii::t('app', 'Thank you for contacting us. We will respond to you as soon as possible.'));
         } else {
             Yii::$app->session->setFlash('error', Yii::t('app', 'There was an error sending email.'));
         }
         return $this->refresh();
     }
     return $this->render('contact', ['model' => $model]);
 }
開發者ID:hlcborg,項目名稱:SainsburysScraper,代碼行數:18,代碼來源:SiteController.php

示例8: actionIndex

 public function actionIndex()
 {
     $model = new ContactForm();
     if ($model->load(Yii::$app->request->post())) {
         if ($model->contact(Yii::$app->params['contactEmail'])) {
             echo json_encode(['success' => true, 'message' => 'Thank you! Your message has been sent, we\'ll get back to you shortly :)']);
         } else {
             echo json_encode(['success' => false, 'message' => 'An unknown error has occured while sending your message. Please check back soon or email us directly to mailto:' . Yii::$app->params['contactEmail']]);
         }
         exit;
     }
     return $this->render('index', ['allProjects' => $this->getProjects(), 'projectCategories' => $this->getProjectCategories(), 'team' => $this->getTeamMembers(), 'cf' => $model]);
 }
開發者ID:yiidottech,項目名稱:site,代碼行數:13,代碼來源:SiteController.php

示例9: actionContact

 public function actionContact()
 {
     $model = new ContactForm();
     if (Yii::$app->request->isAjax && $model->load(Yii::$app->request->post())) {
         Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
         // Validate all but captcha:
         return FnActiveForm::validate($model);
     }
     if ($model->load(Yii::$app->request->post()) && $model->contact(Yii::$app->params['adminEmail'])) {
         Yii::$app->session->setFlash('contactFormSubmitted');
         return $this->refresh();
     }
     return $this->render('contact', ['model' => $model]);
 }
開發者ID:foundationize,項目名稱:yii2,代碼行數:14,代碼來源:SiteController.php

示例10: actionContact

 public function actionContact()
 {
     $model = new ContactForm();
     if (!Yii::$app->user->isGuest) {
         $model->name = Yii::$app->user->identity->name;
         $model->email = Yii::$app->user->identity->email;
     }
     if ($model->load(Yii::$app->request->post()) && $model->contact(Yii::$app->params['supportEmail'])) {
         Yii::$app->session->setFlash('contactFormSubmitted');
         return $this->refresh();
     } else {
         return $this->render('contact', ['model' => $model]);
     }
 }
開發者ID:Sywooch,項目名稱:notes,代碼行數:14,代碼來源:SiteController.php

示例11: actionMail

 public function actionMail()
 {
     $model = new ContactForm();
     if ($model->load(Yii::$app->request->post()) && $model->contact(Yii::$app->params['adminEmail'])) {
         Yii::$app->session->setFlash('contactFormSubmitted');
         return $this->refresh();
     }
     //if ($form->load(Yii::$app->request->post())){
     $listaMails = "No se ha seleccionado ningun mail.";
     if (isset($_REQUEST['enviar_a'])) {
         $listaMails = $_REQUEST['enviar_a'];
     }
     return $this->render('mail', ['listaMails' => $listaMails, 'model' => $model]);
 }
開發者ID:bay122,項目名稱:PCM,代碼行數:14,代碼來源:AlumnosController.php

示例12: actionContact

 public function actionContact()
 {
     $model = new ContactForm();
     if ($model->load(Yii::$app->request->post()) && $model->validate()) {
         if ($model->sendEmail(Yii::$app->params['adminEmail'])) {
             Yii::$app->session->setFlash('success', '感謝您與我們聯係。 我們將盡快回複您.');
         } else {
             Yii::$app->session->setFlash('error', '送電子郵件時出現錯誤。');
         }
         return $this->refresh();
     } else {
         return $this->render('contact', ['model' => $model]);
     }
 }
開發者ID:hehbhehb,項目名稱:hongsong,代碼行數:14,代碼來源:SiteController.php

示例13: actionContact

 public function actionContact()
 {
     $model = new ContactForm();
     if ($model->load(Yii::$app->request->post()) && $model->contact(Yii::$app->params['adminEmail'])) {
         $post = file_get_contents("php://input");
         $data = json_encode($post);
         print_r($data);
         exit;
         Yii::$app->session->setFlash('contactFormSubmitted');
         return $this->refresh();
     } else {
         return $this->render('contact', ['model' => $model]);
     }
 }
開發者ID:hirenbhut93,項目名稱:testdemo,代碼行數:14,代碼來源:SiteController.php

示例14: actionContact

 public function actionContact()
 {
     $model = new ContactForm();
     if ($model->load(Yii::$app->request->post()) && $model->validate()) {
         if ($model->sendEmail(Yii::$app->params['adminEmail'])) {
             Yii::$app->session->setFlash('success', 'Dank u voor uw bericht. Wij zullen zo spoedig mogelijk contact met u opnemen.');
         } else {
             Yii::$app->session->setFlash('error', 'Er ging iets fout met het versturen');
         }
         return $this->refresh();
     } else {
         return $this->render('contact', ['model' => $model, 'page' => 'page-contact']);
     }
     //return $this->render('contact', ['page' => 'page-contact']);
 }
開發者ID:amavis442,項目名稱:vpjuristen,代碼行數:15,代碼來源:SiteController.php

示例15: actionContact

 public function actionContact()
 {
     $model = new ContactForm();
     if ($model->load(Yii::$app->request->post())) {
         $model->name = $_POST['ContactForm']['name'];
         $model->message = $_POST['ContactForm']['message'];
         $model->phone = $_POST['ContactForm']['phone'];
         if ($model->save()) {
             Yii::$app->response->redirect(array('site/contact', 'model' => $model));
         }
         return $this->refresh();
     } else {
         return $this->render('contact', ['model' => $model]);
     }
 }
開發者ID:Evkazolinium,項目名稱:yiiBasicTest,代碼行數:15,代碼來源:SiteController.php


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