Difference between #115 and #116 of
Yii v2 snippet guide

Revision #116 has been created by rackycz on Sep 27, 2019, 8:18:40 AM with the memo:

edit
« previous (#115) next (#117) »

Changes

Title unchanged

Yii v2 snippet guide

Category unchanged

Tutorials

Yii version unchanged

2.0

Tags unchanged

tutorial,beginner,yii2

Content changed

[...]
**Simple access rights**
---
Every controller can allow different users/guests to use different actions. Method behaviors() can be used to do this. If you generate the controller using GII the method will be present and you will just add the "access-part" like this:

```php

 
// don't forget to add this import:
 
use yii\filters\AccessControl;
 
 
public function behaviors() {
return [
// ...
'access' => [
'class' => AccessControl::className(),
'rules' => [
[...]
7 0
4 followers
Viewed: 274 818 times
Version: 2.0
Category: Tutorials
Written by: rackycz
Last updated by: rackycz
Created on: Sep 19, 2019
Last updated: a year ago
Update Article

Revisions

View all history