BaseController.php 691 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace control\controllers;
  3. use yii\filters\AccessControl;
  4. use yii\filters\VerbFilter;
  5. use yii\web\Controller;
  6. class BaseController extends Controller
  7. {
  8. public function behaviors()
  9. {
  10. return [
  11. 'access' => [
  12. 'class' => AccessControl::class,
  13. 'rules' => [
  14. [
  15. 'allow' => true,
  16. 'roles' => ['control'],
  17. ],
  18. ],
  19. ],
  20. 'verbs' => [
  21. 'class' => VerbFilter::class,
  22. 'actions' => [
  23. 'logout' => ['post'],
  24. ],
  25. ],
  26. ];
  27. }
  28. }