1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- namespace app\controllers;
- use Yii;
- use yii\filters\AccessControl;
- use yii\web\Controller;
- class HrToolsController extends Controller
- {
- public function behaviors()
- {
- return [
- 'access' => [
- 'class' => AccessControl::className(),
- 'rules' => [
- [
- 'actions' => ['error'],
- 'allow' => true,
- ],
- [
- 'actions' => ['index','groups','tasks','workflow'],
- '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 actionWorkflow(){
- return $this->render('workflow');
- }
- public function actionGroups(){
- return $this->render('groups');
- }
- public function actionTasks(){
- return $this->render('tasks');
- }
- }
|