{"id":18513727,"url":"https://github.com/proklung/bitrix-primitive-router","last_synced_at":"2025-05-14T12:35:10.301Z","repository":{"id":62530904,"uuid":"374641370","full_name":"ProklUng/bitrix-primitive-router","owner":"ProklUng","description":"Примитивный роутер для Битрикс на компонентах","archived":false,"fork":false,"pushed_at":"2021-06-07T13:37:10.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T07:34:07.533Z","etag":null,"topics":["bitrix","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ProklUng.png","metadata":{"files":{"readme":"readme.MD","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-07T11:29:41.000Z","updated_at":"2021-06-07T13:36:52.000Z","dependencies_parsed_at":"2022-11-02T15:31:57.367Z","dependency_job_id":null,"html_url":"https://github.com/ProklUng/bitrix-primitive-router","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProklUng%2Fbitrix-primitive-router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProklUng%2Fbitrix-primitive-router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProklUng%2Fbitrix-primitive-router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProklUng%2Fbitrix-primitive-router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ProklUng","download_url":"https://codeload.github.com/ProklUng/bitrix-primitive-router/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254142721,"owners_count":22021587,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bitrix","php"],"created_at":"2024-11-06T15:40:24.028Z","updated_at":"2025-05-14T12:35:10.243Z","avatar_url":"https://github.com/ProklUng.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Примитивный роутер для Битрикс на компонентах\n\n### Зачем?\n\nИногда не получается по административно-техническим причинам развернуть нормальный роутер. Один из вариантов поведения\nв такой ситуации - эти компоненты.\n\n## Установка\n\ncomposer.json:\n\n```json\n    \"repositories\": [\n        {\n            \"type\": \"git\",\n            \"url\": \"https://github.com/proklung/bitrix-primitive-router\"\n        }\n    ]\n```\n\n```bash\ncomposer require proklung/bitrix-primitive-router\n```\n\n## Использование\n\nВ `/bitrix/components/base/` прилетят два компонента: `base.router` и `rest.router`\n\n```php\n$APPLICATION-\u003eIncludeComponent('bitrix-primitive-router:base.router', '', array(\n    \"CACHE_TYPE\" =\u003e \"A\",\n    \"CACHE_TIME\" =\u003e 3600,\n    \"SEF_FOLDER\" =\u003e '/article/',\n    \"SEF_MODE\" =\u003e \"Y\",\n    \"SEF_URL_TEMPLATES\" =\u003e array(\n        \"detail\" =\u003e \"#ELEMENT_ID#/\",\n        \"index\" =\u003e \"index.php\",\n    ),\n));\n```\n\n```php\n$APPLICATION-\u003eIncludeComponent('bitrix-primitive-router:rest.router', '', [\n    'SEF_FOLDER' =\u003e '/rest/',\n    'SEF_URL_PATHS' =\u003e[\n      'article/get-list/' =\u003e 'Local\\Rest\\Article::getlist()',\n      'article/get-detail/' =\u003e 'Local\\Rest\\Article::getDetail()',\n      'article/upsert/' =\u003e 'Local\\Rest\\Article::upsert()',\n     ]\n]);\n```\n\n#### base:rest.router\n\nМетоды не статические. Названия классов - полноразмерные. Конструктор должен быть без зависимостей (никакого намека на автовайринг не предусмотрено).\n\nШаблона не предусмотрено. В браузер отправляется json, создающийся из ответа метода-обработчика.\n\nПо соглашению метод-обработчик в возвращаемом массиве может вернуть ключ `httpStatusCode` с HTTP кодом ответа.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproklung%2Fbitrix-primitive-router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fproklung%2Fbitrix-primitive-router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproklung%2Fbitrix-primitive-router/lists"}