KScript 文档
ZH

变更内容

命令

之前 现在
@to_upper($t), @to_lower($t) $t->upper(), $t->lower()
@string($v), @number($t), @date($t), @type($v) $v->to_string(), $t->to_number(), $t->to_date(), $v->type()
@json($t), @to_json($v), @yaml($t), @to_yaml($v) $t->convert(from: json), $v->convert(to: json), $t->convert(from: yaml), $v->convert(to: yaml)
@escape($t), @base64($t), @url_encode($t), @url_decode($t) $t->escape(), $t->to_base64(), $t->url_encode(), $t->url_decode()
@pow($a, $b) $a ** $b
@guid() @uuid()
@contrast(...) @contrast_color(color, dark?, light?)
@signed_in() @is_signed_in()
@log(8, 2) @logarithm(8, 2)(log 是写入日志条目的语句)
@config('database.port', 5432) $config.database.port,或 $config->get('database.port', 5432)
@exit(1), @error('Too short') exit 1, throw Validation "Too short"
@transaction(...) transaction 语句,或 $db->transaction(fn)