Yii v2 snippet guide

Comparing #127 with #128

Revision #128 was created by rackycz rackycz on Oct 4, 2019, 11:58:37 AM.

contact

Content

[...]
- In Site controller replace ContactForm with Contact (in section "use" and in actionContact) and in the action change the IF condition:
```php
use app\models\Contact;
// ...
public function actionContact() {
   $model = new Contact();    if ($model->load(Yii::$app->request->post()) && $model->save()) {    // ...
```
- Open the new contact model and add one attribute, 2 rules
[...]
['verifyCode', 'captcha'],
['email', 'email'],

 
// and translation for Captcha 'verifyCode' => Yii::t('app', 'Verification'), ``` - You can also delete one paragraph from view/site/contact ```HTMLphp
<p>
Note that if you turn on the Yii debugger ...
```

**Tests - unit + opa**
[...]