全栈小学生 39a8e9ede2 core
2023-05-20 18:29:52 +08:00

27 lines
576 B
PHP

<?php
namespace core\addon;
class Route extends BaseAddon
{
/**
* 加载路由
* @param array $data 传入路由端口
* @return array|mixed
*/
public function load(array $data)
{
$addons = $this->getLocalAddons();
foreach ($addons as $k => $v)
{
$route_path = $this->getAddonAppPath($v). DIRECTORY_SEPARATOR. $data['app_type']. DIRECTORY_SEPARATOR. "route.php";
if(is_file($route_path))
{
include $route_path;
}
}
return true;
}
}