webman迁移-优化curd

This commit is contained in:
2026-03-18 15:24:32 +08:00
parent e2ae55319e
commit a64d157388
4 changed files with 31 additions and 11 deletions

View File

@@ -424,13 +424,17 @@ class Helper
return root_path() . 'app' . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR . 'library' . DIRECTORY_SEPARATOR . 'crud' . DIRECTORY_SEPARATOR . 'stubs' . DIRECTORY_SEPARATOR . Filesystem::fsFit($name) . '.stub';
}
public static function arrayToString(array|string $value): string
public static function arrayToString(mixed $value): string
{
if (!is_array($value)) return $value;
foreach ($value as &$item) {
$item = self::arrayToString($item);
if (is_array($value)) {
foreach ($value as &$item) {
$item = self::arrayToString($item);
}
return implode(PHP_EOL, $value);
}
return implode(PHP_EOL, $value);
if (is_string($value)) return $value;
if (is_bool($value)) return $value ? 'true' : 'false';
return $value === null ? '' : strval($value);
}
public static function assembleStub(string $name, array $data, bool $escape = false): string