1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- namespace app\controllers;
- use Yii;
- use yii\filters\AccessControl;
- use yii\web\Controller;
- class AdminToolsController extends Controller
- {
- public function behaviors()
- {
- return [
- 'access' => [
- 'class' => AccessControl::className(),
- 'rules' => [
- [
- 'actions' => ['error'],
- 'allow' => true,
- ],
- [
- 'actions' => ['index','userimport'],
- 'allow' => true,
- 'roles' => ['@'],
- ],
- ],
- ]
- ];
- }
- //This method should be in every controller
- public function init(){
- if (!Yii::$app->user->isGuest){
- Yii::$app->language = Yii::$app->user->identity->lang;
- }
- }
- public function actionIndex()
- {
- return $this->render('index');
- }
- public function actionUserimport()
- {
- return $this->render('userimport');
- }
- }
|