Commit 10d8239e authored by Shakarim Sapa's avatar Shakarim Sapa

- Add new validation rule

parent 80dde071
...@@ -19,6 +19,7 @@ if ($cacheEmail!==false && Bid::find()->where(['email' => $cacheEmail])->exists( ...@@ -19,6 +19,7 @@ if ($cacheEmail!==false && Bid::find()->where(['email' => $cacheEmail])->exists(
$model = new Bid; $model = new Bid;
$model->setScenario(Bid::SCENARIO_SUBSCRIBE); $model->setScenario(Bid::SCENARIO_SUBSCRIBE);
$model->form = Bid::FORM_SUBSCRIBE; $model->form = Bid::FORM_SUBSCRIBE;
$errors = $model->getErrors();
$form = ActiveForm::begin([ $form = ActiveForm::begin([
'action' => '/bids/bid/blogadd', 'action' => '/bids/bid/blogadd',
...@@ -45,7 +46,7 @@ if ($cacheEmail!==false && Bid::find()->where(['email' => $cacheEmail])->exists( ...@@ -45,7 +46,7 @@ if ($cacheEmail!==false && Bid::find()->where(['email' => $cacheEmail])->exists(
])->textInput([ ])->textInput([
'placeholder' => 'E-mail*' 'placeholder' => 'E-mail*'
]); ?> ]); ?>
<?php echo $model->getErrors('email'); ?> <?php echo $errors['email']; ?>
<?php echo Html::submitButton(\Yii::t('form', 'Subscribe'), ['class' => 'save-button']); ?> <?php echo Html::submitButton(\Yii::t('form', 'Subscribe'), ['class' => 'save-button']); ?>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment