UController.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace app\common\controllers;
  3. use app\common\components\SiteUrl;
  4. use Yii;
  5. /**
  6. * 用户中心基类
  7. */
  8. class UController extends FController
  9. {
  10. public $layout = 'uc';
  11. public $tableConfig;//列表页配置
  12. public $tableTitle;//列表页表头
  13. public $topLeftTableMenu;
  14. public $topRightTableMenu;
  15. public $operTableMenu;
  16. public $assetsUrl;
  17. public function behaviors()
  18. {
  19. parent::behaviors();
  20. return [
  21. [
  22. 'class' => 'app\common\filters\FrontEndAuthFilter',
  23. 'except' => ['login','register','forgetpwd','vip']
  24. ],
  25. [
  26. 'class' => 'app\common\filters\FrontEndLoginedFilter',
  27. 'only' => ['login','register']
  28. ],
  29. [
  30. 'class' => 'app\common\filters\FrontEndTokenFilter',
  31. 'except' => ['login','register','forgetpwd']
  32. ],
  33. ];
  34. }
  35. public function init()
  36. {
  37. parent::init();
  38. $this->navList = $this->getNavData(3);
  39. $this->breadcrumbs[] = ['label' => '用户中心','url' =>SiteUrl::ucenter()];
  40. $asset = \app\assets\PcAsset::register(Yii::$app->getView());
  41. $this->assetsUrl = $asset->baseUrl;
  42. }
  43. }