This commit is contained in:
xl
2023-11-10 14:01:37 +08:00
parent 6a62facef0
commit 314fadca7f
+2 -25
View File
@@ -204,7 +204,7 @@ class {$controllerName}Controller extends Controller
$_path = ltrim($_path, '/'); $_path = ltrim($_path, '/');
// $this->getData($path, $className, $fields); $this->getData($path, $className, $fields);
return ' return '
/** /**
@@ -635,33 +635,10 @@ use Kiri\ToArray;
/** /**
* FormData * FormData
*/ */
class ' . $formClass . 'Form implements ToArray, \JsonSerializable, \Stringable class ' . $formClass . 'Form implements \Arrayable
{ {
' . $class . ' ' . $class . '
/**
* @return bool|string
*/
public function jsonSerialize(): bool|string
{
// TODO: Implement jsonSerialize() method.
return json_encode($this->toArray(), JSON_UNESCAPED_UNICODE);
}
/**
* @return string
*/
public function __toString(): string
{
// TODO: Implement __toString() method.
$json = $this->jsonSerialize();
if (!$json) {
return \'\';
}
return $json;
}
/** /**