BaseController.php 398 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace backend\controllers;
  3. use yii\web\Controller;
  4. /**
  5. * Class BaseController
  6. * @package backend\controllers
  7. */
  8. class BaseController extends Controller
  9. {
  10. public function init()
  11. {
  12. \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
  13. parent::init();
  14. }
  15. public function beforeAction($action)
  16. {
  17. //todo
  18. /*if (Yii::$app->user->isGuest) {
  19. }*/
  20. return true;
  21. }
  22. }