Revision #131 has been created by rackycz on Oct 4, 2019, 12:11:08 PM with the memo:
contact
« previous (#130) next (#132) »
Changes
Title
unchanged
Yii v2 snippet guide
Category
unchanged
Tutorials
Yii version
unchanged
2.0
Tags
unchanged
tutorial,beginner,yii2
Content
changed
[...]
```php
<p>
Note that if you turn on the Yii debugger ...
```
Then some security - filtering users in the new ContactController:
```php
public function beforeAction($action) {
if (!parent::beforeAction($action)) {
return false;
}
$guestAllowedActions = [];
if (Yii::$app->user->isGuest) {
if (!in_array($action->actionMethod, $guestAllowedActions)) {
return $this->redirect(['site/index']);
}
}
return true;
}
```
**Tests - unit + opa**
---
... text ...