Route.php 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Niucloud-admin 企业快速开发的saas管理平台
  4. // +----------------------------------------------------------------------
  5. // | 官方网址:https://www.niucloud.com
  6. // +----------------------------------------------------------------------
  7. // | niucloud团队 版权所有 开源版本可自由商用
  8. // +----------------------------------------------------------------------
  9. // | Author: Niucloud Team
  10. // +----------------------------------------------------------------------
  11. namespace core\dict;
  12. class Route extends BaseDict
  13. {
  14. /**
  15. * 加载路由
  16. * @param array $data 传入路由端口
  17. * @return true
  18. */
  19. public function load(array $data)
  20. {
  21. $addons = $this->getLocalAddons();
  22. foreach ($addons as $k => $v) {
  23. $route_path = $this->getAddonAppPath($v) . DIRECTORY_SEPARATOR . $data['app_type'] . DIRECTORY_SEPARATOR . "route" . DIRECTORY_SEPARATOR . "route.php";
  24. if (is_file($route_path)) {
  25. include $route_path;
  26. }
  27. }
  28. return true;
  29. }
  30. }