contact.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. use yii\helpers\Html;
  3. use yii\widgets\ActiveForm;
  4. use yii\widgets\Captcha;
  5. /**
  6. * @var yii\base\View $this
  7. * @var yii\widgets\ActiveForm $form
  8. * @var app\models\ContactForm $model
  9. */
  10. $this->title = 'Contact';
  11. $this->params['breadcrumbs'][] = $this->title;
  12. ?>
  13. <h1><?php echo Html::encode($this->title); ?></h1>
  14. <?php if (Yii::$app->session->hasFlash('contactFormSubmitted')): ?>
  15. <div class="alert alert-success">
  16. Thank you for contacting us. We will respond to you as soon as possible.
  17. </div>
  18. <?php return; endif; ?>
  19. <p>
  20. If you have business inquiries or other questions, please fill out the following form to contact us. Thank you.
  21. </p>
  22. <?php $form = ActiveForm::begin(array(
  23. 'model' => $model,
  24. 'options' => array('class' => 'form-horizontal'),
  25. 'fieldConfig' => array('inputOptions' => array('class' => 'input-xlarge')),
  26. )); ?>
  27. <?php echo $form->field('name')->textInput(); ?>
  28. <?php echo $form->field('email')->textInput(); ?>
  29. <?php echo $form->field('subject')->textInput(); ?>
  30. <?php echo $form->field('body')->textArea(array('rows' => 6)); ?>
  31. <?php echo $form->field('verifyCode')->widget(Captcha::className(), array(
  32. 'options' => array('class' => 'input-medium'),
  33. )); ?>
  34. <div class="form-actions">
  35. <?php echo Html::submitButton('Submit', null, null, array('class' => 'btn btn-primary')); ?>
  36. </div>
  37. <?php ActiveForm::end(); ?>