IndexController.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Administrator
  5. * Date: 2018/2/26/026
  6. * Time: 9:56
  7. */
  8. namespace backend\controllers;
  9. use backend\base\CommonController;
  10. use Yii;
  11. use yii\helpers\ArrayHelper;
  12. class IndexController extends CommonController
  13. {
  14. // public $enableCsrfValidation = false;
  15. // public function behaviors()
  16. // {
  17. // // 声明缓存配置
  18. // return [ // 需要注意的这里是二维数组
  19. // [
  20. // 'class' => 'yii\filters\HttpCache', // 设置需要加载的缓存文件
  21. // 'only' => ['index'], // 设置需要缓存的控制器
  22. // 'lastModified' => function(){ // 设置 Last-Modified 头
  23. // return 1548922;
  24. // },
  25. // 'etagSeed' => function (){ // 设置 ETag 头
  26. // return 'hello';
  27. // }
  28. // ]
  29. // ];
  30. // }
  31. /*
  32. * 菜单栏
  33. * */
  34. public function actionIndex()
  35. {
  36. $model = new \backend\server\Menus();
  37. $row = $model->TopMenu();
  38. // p($row);
  39. // exit;
  40. return $this->render('index',['model'=>$row]);
  41. }
  42. /*
  43. * 首页
  44. * */
  45. public function actionMain()
  46. {
  47. return $this->render('main');
  48. }
  49. /*
  50. * 首页 -通知详情
  51. */
  52. public function actionShow()
  53. {
  54. return $this->render('show');
  55. }
  56. }