bitrix-controllers

Automate Bitrix D7 controller development with parameter binding and ActionFilter security.

33|3|Updated Jun 5, 2025
One-click install
npx skills add https://github.com/bxmaximum/bitrix_ai_challenge --skill bitrix-controllers
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bitrix-controllers
Source: https://github.com/bxmaximum/bitrix_ai_challenge/tree/main/.agents/skills/bitrix-controllers
Command: npx skills add https://github.com/bxmaximum/bitrix_ai_challenge --skill bitrix-controllers

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Обеспечивает единый подход к созданию и управлению D7-контроллерами в Bitrix, облегчая автосвязывание параметров, настройку фильтров действий и обработку ошибок, что ускоряет разработку AJAX/REST-эндпоинтов.

Core Features & Use Cases

  • Автосвязь параметров действий — автоматически маппит параметры запроса в сигнатуры контроллеров.
  • Фильтры действий — интегрированные фильтры (Authentication, Csrf, HttpMethod, Scope, CloseSession, ContentType) с настройками в configureActions.
  • Обработка ошибок — единый механизм добавления ошибок через addError/ErrorCollection вместо исключений.
  • Развертывание AJAX/REST-эндпоинтов — применяется для реализации AJAX-эндпоинтов и REST-интеграций через Controllerable.
  • Рендеринг и JSON-ответы — поддерживает как возвращаемые массивы, так и форматированные ответы.

Quick Start

Create a new Bitrix D7 controller module and expose an AJAX endpoint through the Controllerable framework.

Frequently Asked Questions about bitrix-controllers

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create secure AJAX endpoints in Bitrix D7?

To create secure AJAX endpoints in Bitrix D7, you implement the Controllerable framework and configure ActionFilter security. This enforces Csrf, Authentication, and HttpMethod validation while standardizing parameter auto-binding for reliable data handling.

What is the best way to handle parameter binding in Bitrix controllers?

The best way to handle parameter binding in Bitrix controllers is using native auto-mapping. This mechanism automatically maps request parameters directly to controller method signatures, eliminating manual extraction and ensuring consistent data input.

How does error reporting work in Bitrix D7 controller development?

Error reporting in Bitrix D7 controller development uses a standardized mechanism through addError and ErrorCollection instead of throwing exceptions. This ensures consistent error formatting across all AJAX and REST endpoint responses.

Can I use Bitrix ActionFilters to restrict access to REST endpoints?

Yes, you can restrict access to REST endpoints by configuring ActionFilters in the configureActions method. You can enforce Authentication, Scope, HttpMethod, CloseSession, and ContentType filters to secure your Bitrix controller actions.

Do I need the Controllerable interface to build REST integrations in Bitrix?

Yes, you need the Controllerable interface to build REST integrations in Bitrix. Implementing Controllerable allows you to expose structured controller methods as REST endpoints with standardized JSON responses and integrated action filtering.