yiisoft /
yii2-app-basic
| 1 | <?php |
||||
| 2 | |||||
| 3 | /** @var yii\web\View $this */ |
||||
| 4 | /** @var yii\bootstrap5\ActiveForm $form */ |
||||
| 5 | /** @var app\models\ContactForm $model */ |
||||
| 6 | |||||
| 7 | use yii\bootstrap5\ActiveForm; |
||||
| 8 | use yii\bootstrap5\Html; |
||||
| 9 | use yii\captcha\Captcha; |
||||
| 10 | |||||
| 11 | $this->title = 'Contact'; |
||||
| 12 | $this->params['breadcrumbs'][] = $this->title; |
||||
| 13 | ?> |
||||
| 14 | <div class="site-contact"> |
||||
| 15 | <h1><?= Html::encode($this->title) ?></h1> |
||||
| 16 | |||||
| 17 | <?php if (Yii::$app->session->hasFlash('contactFormSubmitted')): ?> |
||||
|
0 ignored issues
–
show
|
|||||
| 18 | |||||
| 19 | <div class="alert alert-success"> |
||||
| 20 | Thank you for contacting us. We will respond to you as soon as possible. |
||||
| 21 | </div> |
||||
| 22 | |||||
| 23 | <p> |
||||
| 24 | Note that if you turn on the Yii debugger, you should be able |
||||
| 25 | to view the mail message on the mail panel of the debugger. |
||||
| 26 | <?php if (Yii::$app->mailer->useFileTransport): ?> |
||||
|
0 ignored issues
–
show
|
|||||
| 27 | Because the application is in development mode, the email is not sent but saved as |
||||
| 28 | a file under <code><?= Yii::getAlias(Yii::$app->mailer->fileTransportPath) ?></code>. |
||||
|
0 ignored issues
–
show
The method
getAlias() does not exist on Yii.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||||
| 29 | Please configure the <code>useFileTransport</code> property of the <code>mail</code> |
||||
| 30 | application component to be false to enable email sending. |
||||
| 31 | <?php endif; ?> |
||||
| 32 | </p> |
||||
| 33 | |||||
| 34 | <?php else: ?> |
||||
| 35 | |||||
| 36 | <p> |
||||
| 37 | If you have business inquiries or other questions, please fill out the following form to contact us. |
||||
| 38 | Thank you. |
||||
| 39 | </p> |
||||
| 40 | |||||
| 41 | <div class="row"> |
||||
| 42 | <div class="col-lg-5"> |
||||
| 43 | |||||
| 44 | <?php $form = ActiveForm::begin(['id' => 'contact-form']); ?> |
||||
| 45 | |||||
| 46 | <?= $form->field($model, 'name')->textInput(['autofocus' => true]) ?> |
||||
| 47 | |||||
| 48 | <?= $form->field($model, 'email') ?> |
||||
| 49 | |||||
| 50 | <?= $form->field($model, 'subject') ?> |
||||
| 51 | |||||
| 52 | <?= $form->field($model, 'body')->textarea(['rows' => 6]) ?> |
||||
| 53 | |||||
| 54 | <?= $form->field($model, 'verifyCode')->widget(Captcha::class, [ |
||||
| 55 | 'template' => '<div class="row"><div class="col-lg-3">{image}</div><div class="col-lg-6">{input}</div></div>', |
||||
| 56 | ]) ?> |
||||
| 57 | |||||
| 58 | <div class="form-group"> |
||||
| 59 | <?= Html::submitButton('Submit', ['class' => 'btn btn-primary', 'name' => 'contact-button']) ?> |
||||
| 60 | </div> |
||||
| 61 | |||||
| 62 | <?php ActiveForm::end(); ?> |
||||
| 63 | |||||
| 64 | </div> |
||||
| 65 | </div> |
||||
| 66 | |||||
| 67 | <?php endif; ?> |
||||
| 68 | </div> |
||||
| 69 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.