Drupal investigation

contact.php 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. /* @var $this yii\web\View */
  3. /* @var $form yii\bootstrap\ActiveForm */
  4. /* @var $model app\models\ContactForm */
  5. use yii\helpers\Html;
  6. use yii\bootstrap\ActiveForm;
  7. use yii\captcha\Captcha;
  8. $this->title = 'Contact';
  9. $this->params['breadcrumbs'][] = $this->title;
  10. ?>
  11. <div class="site-contact custom-block">
  12. <h1><?= Html::encode($this->title) ?></h1>
  13. <?php if (Yii::$app->session->hasFlash('contactFormSubmitted')): ?>
  14. <div class="alert alert-success">
  15. Thank you for contacting us. We will respond to you as soon as possible.
  16. </div>
  17. <p>
  18. Note that if you turn on the Yii debugger, you should be able
  19. to view the mail message on the mail panel of the debugger.
  20. <?php if (Yii::$app->mailer->useFileTransport): ?>
  21. Because the application is in development mode, the email is not sent but saved as
  22. a file under <code><?= Yii::getAlias(Yii::$app->mailer->fileTransportPath) ?></code>.
  23. Please configure the <code>useFileTransport</code> property of the <code>mail</code>
  24. application component to be false to enable email sending.
  25. <?php endif; ?>
  26. </p>
  27. <?php else: ?>
  28. <p>
  29. If you have business inquiries or other questions, please fill out the following form to contact us.
  30. Thank you.
  31. </p>
  32. <div class="row">
  33. <div class="col-lg-5">
  34. <?php $form = ActiveForm::begin(['id' => 'contact-form']); ?>
  35. <?= $form->field($model, 'name')->textInput(['autofocus' => true]) ?>
  36. <?= $form->field($model, 'email') ?>
  37. <?= $form->field($model, 'subject') ?>
  38. <?= $form->field($model, 'body')->textarea(['rows' => 6]) ?>
  39. <?= $form->field($model, 'verifyCode')->widget(Captcha::className(), [
  40. 'template' => '<div class="row"><div class="col-lg-3">{image}</div><div class="col-lg-6">{input}</div></div>',
  41. ]) ?>
  42. <div class="form-group">
  43. <?= Html::submitButton('Submit', ['class' => 'btn btn-primary', 'name' => 'contact-button']) ?>
  44. </div>
  45. <?php ActiveForm::end(); ?>
  46. </div>
  47. </div>
  48. <?php endif; ?>
  49. </div>