Skip to content

Instantly share code, notes, and snippets.

@larek
Last active August 14, 2020 11:09
Show Gist options
  • Save larek/98c84bc8b88ef36ea0b04fddb6848419 to your computer and use it in GitHub Desktop.
Save larek/98c84bc8b88ef36ea0b04fddb6848419 to your computer and use it in GitHub Desktop.
Update modules/admin/Module.php file
<?php
namespace app\modules\admin;
use yii\filters\AccessControl;
/**
* admin module definition class
*/
class Module extends \yii\base\Module
{
/**
* {@inheritdoc}
*/
public function behaviors()
{
return [
'access' => [
'class' => AccessControl::class,
'rules' => [
[
'allow' => true,
'roles' => ['@'],
],
],
]
];
}
/**
* {@inheritdoc}
*/
public $controllerNamespace = 'app\modules\admin\controllers';
/**
* {@inheritdoc}
*/
public function init()
{
parent::init();
// custom initialization code goes here
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment