bitrix-request-response
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseApplication, Context, Request, Response
Application、Context、Request、Response
Baseline: main 23.0+. Features newer than baseline are marked Since.
Progressive disclosure: open only the rule files that match the task. Do not read every .
rules/*.md基准版本:main 23.0+。晚于基准版本的功能会标记为Since。
渐进式查阅:仅打开与任务匹配的规则文件。无需阅读所有文件。
rules/*.mdHow to use
使用方法
- Identify the layer the task touches.
- Open the matching below.
rules/*.md - Prefer framework-native Bitrix patterns over custom abstractions.
- 确定任务涉及的层级。
- 打开下方匹配的文件。
rules/*.md - 优先使用框架原生的Bitrix模式,而非自定义抽象实现。
Choose a rule file
选择规则文件
When to read rules/application-context.md
rules/application-context.md何时阅读rules/application-context.md
rules/application-context.mdRead () when the task involves:
rules/application-context.mdApplication and Context- Application
- Context
当任务涉及以下内容时,请阅读(《Application与Context》):
rules/application-context.md- Application
- Context
When to read rules/request.md
rules/request.md何时阅读rules/request.md
rules/request.mdRead () when the task involves:
rules/request.mdHttpRequest and JSON body- HttpRequest
- ParameterDictionary
当任务涉及以下内容时,请阅读(《HttpRequest与JSON请求体》):
rules/request.md- HttpRequest
- ParameterDictionary
When to read rules/response.md
rules/response.md何时阅读rules/response.md
rules/response.mdRead () when the task involves:
rules/response.mdHttpResponse and typed responses- HttpResponse
- Built-in Response Classes
- Checklist
- Encrypted Cookies
当任务涉及以下内容时,请阅读(《HttpResponse与类型化响应》):
rules/response.md- HttpResponse
- 内置响应类
- 检查清单
- 加密Cookie
When to read rules/uri-uuid.md
rules/uri-uuid.md何时阅读rules/uri-uuid.md
rules/uri-uuid.mdRead () when the task involves:
rules/uri-uuid.mdUri and UuidGenerator- Uri
- UuidGenerator
当任务涉及以下内容时,请阅读(《Uri与UuidGenerator》):
rules/uri-uuid.md- Uri
- UuidGenerator
Converter (not covered by rule files)
转换器(未包含在规则文件中)
Bitrix\Main\Engine\Response\ConverterTO_SNAKETO_SNAKE_DIGITTO_CAMELTO_UPPERTO_LOWERLC_FIRSTUC_FIRSTKEYSVALUESRECURSIVEprocess($data)getFormat()setFormat($format)toJson()Converter::OUTPUT_JSON_FORMATKEYS | RECURSIVE | TO_CAMEL | LC_FIRSTVALUESphp
use Bitrix\Main\Engine\Response\Converter;
(new Converter(Converter::LC_FIRST | Converter::TO_CAMEL))->process('la_la_land'); // laLaLand
(new Converter(Converter::OUTPUT_JSON_FORMAT))->process([
'CATEGORIES' => [['ID' => 1, 'NAME' => 'Foods']],
]);
// ['categories' => [['id' => 1, 'name' => 'Foods']]] — 'Foods' stays untouched (no VALUES flag)Bitrix\Main\Engine\Response\ConverterTO_SNAKETO_SNAKE_DIGITTO_CAMELTO_UPPERTO_LOWERLC_FIRSTUC_FIRSTKEYSVALUESRECURSIVEprocess($data)getFormat()setFormat($format)toJson()Converter::OUTPUT_JSON_FORMATKEYS | RECURSIVE | TO_CAMEL | LC_FIRSTVALUESphp
use Bitrix\Main\Engine\Response\Converter;
(new Converter(Converter::LC_FIRST | Converter::TO_CAMEL))->process('la_la_land'); // laLaLand
(new Converter(Converter::OUTPUT_JSON_FORMAT))->process([
'CATEGORIES' => [['ID' => 1, 'NAME' => 'Foods']],
]);
// ['categories' => [['id' => 1, 'name' => 'Foods']]] — 'Foods'保持不变(无VALUES标志)Checklist
检查清单
- Opened only the rule file(s) needed for this task.
- Followed DI / / security canons from
/local/.AGENTS.md
- 仅打开了当前任务所需的规则文件。
- 遵循了中的依赖注入(DI)/
AGENTS.md目录规范/安全准则。/local/