webman迁移-优化curd
This commit is contained in:
@@ -377,11 +377,16 @@ if (!function_exists('parse_name')) {
|
||||
if (!function_exists('root_path')) {
|
||||
/**
|
||||
* 根路径(BuildAdmin 兼容,等价于 base_path)
|
||||
* 无参数时返回带尾部分隔符的路径,确保 root_path() . 'app' 拼接正确
|
||||
* @param string $path 子路径
|
||||
*/
|
||||
function root_path(string $path = ''): string
|
||||
{
|
||||
return base_path($path);
|
||||
$base = base_path($path);
|
||||
if ($path === '' && $base !== '') {
|
||||
return rtrim($base, DIRECTORY_SEPARATOR . '/') . DIRECTORY_SEPARATOR;
|
||||
}
|
||||
return $base;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user