webman迁移-优化curd
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -11,10 +11,10 @@ class {%className%} extends Backend
|
||||
{
|
||||
/**
|
||||
* {%modelName%}模型对象
|
||||
* @var object
|
||||
* @phpstan-var \{%modelNamespace%}\{%modelName%}
|
||||
* @var object|null
|
||||
* @phpstan-var \{%modelNamespace%}\{%modelName%}|null
|
||||
*/
|
||||
protected object $model;
|
||||
protected ?object $model = null;
|
||||
{%attr%}{%initialize%}
|
||||
{%methods%}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user